Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {Волкович Максим (volkovcih.maksim.s@gmail.com), 112гр., v1.0,
- описать процедуру, которая вставляет новый элемент E после первого элемента списка L}
- type T=...;
- list=^chain;
- chain=record elem:T; next:list end;
- procedure ctrlV(E:T;L:list);
- var p,s:list;
- begin
- s:=L^.next;
- p^.elem:=L^.elem;
- new(p^.next);
- p^.next^.elem:=E;
- p^.next^.next:=s;
- L:=p;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement