mirror of
https://github.com/Gustavo-E-D-Demarchi/dicionario.git
synced 2026-07-27 16:25:46 -03:00
tentando enteder mais não vai
This commit is contained in:
committed by
GitHub
parent
56be04636d
commit
c51d75f5a1
+18
-6
@@ -27,7 +27,8 @@ program pzim;
|
|||||||
|
|
||||||
procedure adicionar_lista(var lista : Tlista ; chave : string);
|
procedure adicionar_lista(var lista : Tlista ; chave : string);
|
||||||
var
|
var
|
||||||
aux , aux2 : Tlista;
|
aux , aux_Ant , aux_Prox : Tlista;
|
||||||
|
temp_s : string;
|
||||||
begin
|
begin
|
||||||
new(aux);
|
new(aux);
|
||||||
if
|
if
|
||||||
@@ -36,10 +37,21 @@ program pzim;
|
|||||||
begin
|
begin
|
||||||
while aux^.prox <> nil do
|
while aux^.prox <> nil do
|
||||||
aux := aux^.prox;
|
aux := aux^.prox;
|
||||||
|
temp_s := aux^.key;
|
||||||
aux^.key := chave ;//
|
|
||||||
|
new (aux_Ant);
|
||||||
|
new (aux_Prox);
|
||||||
|
|
||||||
|
if maior(temp_s , chave)then
|
||||||
|
begin
|
||||||
|
if aux^.ant <> nil then
|
||||||
|
aux_Ant := aux^.ant ;
|
||||||
|
if aux^.prox <> nil then
|
||||||
|
aux_Prox := aux^.prox;
|
||||||
|
|
||||||
|
aux^.key := chave ;//
|
||||||
|
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -71,4 +83,4 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
end.
|
end.
|
||||||
|
|||||||
Reference in New Issue
Block a user