20 likes | 370 Views
STRUCTURI DINAMICE DE DATE. LISTE UNIDIRECŢIONALE inserarea unui element. MEMORIA. Segmentul de date. Heap (grămada). P. 010. 010. A. 020. R. 050. 040. 010. 020. 040. 030. nil. 020. B. 050. 030. V. 040. 050. 030. C. 040. 040. D. nil. 050. 060. 070. 080. 090.
E N D
STRUCTURI DINAMICE DE DATE LISTE UNIDIRECŢIONALE inserarea unui element
MEMORIA Segmentul de date Heap (grămada) P 010 010 A 020 R 050 040 010 020 040 030 nil 020 B 050 030 V 040 050 030 C 040 040 D nil 050 060 070 080 090 100 Info Urm Procedure Includ; var s:string; var s:string; var s:string; begin R:=P; R:=P; R:=P; readln(s); readln(s); readln(s); while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do while R<>nil do begin if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s if R^.Info=s then begin new(V); new(V); new(V); readln(V^.Info); readln(V^.Info); readln(V^.Info); S B V^.Urm:=R^.Urm; V^.Urm:=R^.Urm; V^.Urm:=R^.Urm; F 030 R^.Urm:=V; R^.Urm:=V; R^.Urm:=V; end; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; R:=R^.Urm; end; end; end;