tentando enteder mais não vai

This commit is contained in:
Gustavo Erlindo Dellajustina Demarchi
2026-04-29 11:28:35 -03:00
committed by GitHub
parent 56be04636d
commit c51d75f5a1
+18 -6
View File
@@ -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.