1 / 34

Lista Duplamente Encandeada New(p);

LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA. P. AA. Lista Duplamente Encandeada New(p);. AA. 0. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA. P. AA. Lista Duplamente Encandeada New(p); P^.prox := nil;. AA. 0. Prox =NIL.

nyoko
Download Presentation

Lista Duplamente Encandeada New(p);

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA P AA Lista Duplamente Encandeada New(p); AA 0

  2. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA P AA Lista Duplamente Encandeada New(p); P^.prox := nil; AA 0 Prox=NIL

  3. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA P AA Lista Duplamente Encandeada New(p); P^.prox := nil; P^.ant := nil; AA 0 Ant=NIL Prox=NIL

  4. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA L P AA AA Lista Duplamente Encandeada New(p); P^.prox := nil; P^.ant := nil; L := P; AA 0 Ant=NIL Prox=NIL

  5. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO QUANDO LISTA VAZIA F L P AA AA AA Lista Duplamente Encandeada New(p); P^.prox := nil; P^.ant := nil; L := P; F := P; AA 001 Jose 0 R$ 1500,00 Ant=NIL Prox=NIL

  6. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO SEQUENCIAL NO FINAL DA LISTA F AA L P AA AA Lista Duplamente Encandeada New(f^.prox); AA BB 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB

  7. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO SEQUENCIAL NO FINAL DA LISTA F P AA BB L AA Lista Duplamente Encandeada New(f^.prox); P:= f^.prox; AA BB 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB

  8. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO SEQUENCIAL NO FINAL DA LISTA F P AA BB L AA Lista Duplamente Encandeada New(f^.prox); P:= f^.prox; p^.ant :=F AA BB 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA

  9. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO SEQUENCIAL NO FINAL DA LISTA F P BB BB L AA Lista Duplamente Encandeada New(f^.prox); P:= f^.prox; p^.ant :=F; F := P; AA BB 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA

  10. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO SEQUENCIAL NO FINAL DA LISTA F P BB BB L AA Lista Duplamente Encandeada New(f^.prox); P:= f^.prox; p^.ant :=F; F := P; P^.prox := nil; AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA Prox=NIL

  11. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB L AA Lista Duplamente Encandeada AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA Prox=NIL

  12. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB L AA Lista Duplamente Encandeada New(P); AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA Prox=NIL P CC CC 0 Prox=NIL

  13. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB L AA Lista Duplamente Encandeada New(P); P^.prox := L; AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA Prox=NIL P CC CC 0 Prox=AA

  14. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB L AA Lista Duplamente Encandeada New(P); P^.prox := L; P^.ant := nil; AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=BB Ant AA Prox=NIL P CC CC 0 Ant=NIL Prox=AA

  15. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB L AA Lista Duplamente Encandeada New(P); P^.prox := L; P^.ant := nil; L^.ant : P; AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=CC Prox=BB Ant AA Prox=NIL P CC CC 0 Ant= NIL Prox=AA

  16. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB Lista Duplamente Encandeada New(P); P^.prox := L; P^.ant := nil; L^.ant : P; L := P; AA BB 002 Antonio R$ 1000,00 001 Jose 0 R$ 1500,00 Ant=CC Prox=BB Ant AA Prox=NIL L P CC CC CC 0 Ant = NIL Prox=AA

  17. LISTA DUPLAMENTE ENCADEADA – INCLUSÃO INICIO DA LISTA F BB L P Lista Duplamente Encandeada New(P); P^.prox := L; P^.ant := nil; L^.ant : P; L := P; CC CC CC AA BB 002 Antonio R$ 1000,00 003 Carlos 0 R$ 780,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=AA Ant=CC Prox=BB Ant AA Prox=NIL

  18. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO FINAL DA LISTA F BB L Lista Duplamente Encandeada CC CC AA BB 002 Antonio R$ 1000,00 003 Carlos 0 R$ 780,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=AA Ant=CC Prox=BB Ant AA Prox=NIL

  19. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO FINAL DA LISTA P F AA BB L Lista Duplamente Encandeada P := F^.ant; CC CC AA BB 002 Antonio R$ 1000,00 003 Carlos 0 R$ 780,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=AA Ant=CC Prox=BB Ant AA Prox=NIL

  20. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO FINAL DA LISTA P F AA BB L Lista Duplamente Encandeada P := F^.ant; P^.prox := NIL; CC CC AA BB 002 Antonio R$ 1000,00 003 Carlos 0 R$ 780,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=AA Ant=CC Prox=NIL Ant AA Prox=NIL

  21. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO FINAL DA LISTA P F AA BB L Lista Duplamente Encandeada P := F^.ant; P^.prox := NIL; Dispose(F); CC CC AA BB 002 Antonio R$ 1000,00 003 Carlos 0 R$ 780,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=AA Ant=CC Prox=NIL Ant AA Prox=NIL

  22. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO FINAL DA LISTA P F AA BB L Lista Duplamente Encandeada P := F^.ant; P^.prox := NIL; Dispose(F); F:= P; CC CC AA 003 Carlos 0 R$ 780,00 001 Jose 0 R$ 1500,00 Ant=NIL Prox=AA Ant=CC Prox=NIL

  23. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO NO INICIO/FINAL QUANDO LISTA TEM SOMENTE UM ELEMENTO Lista Duplamente Encandeada F L AA AA AA 001 Jose 0 R$ 1500,00 Ant=NIL Prox=NIL

  24. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO NO INICIO/FINAL QUANDO LISTA TEM SOMENTE UM ELEMENTO Lista Duplamente Encandeada Dispose(F); F L AA AA AA 001 Jose 0 R$ 1500,00 Ant=NIL Prox=NIL

  25. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO NO INICIO/FINAL QUANDO LISTA TEM SOMENTE UM ELEMENTO Lista Duplamente Encandeada Dispose(F); F L AA AA

  26. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO NO INICIO/FINAL QUANDO LISTA TEM SOMENTE UM ELEMENTO Lista Duplamente Encandeada Dispose(F); L :=NIL; F := NIL; F L AA AA

  27. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=CC Ant=BB Prox=DD Ant CC Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End;

  28. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB R p AA BB L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=CC Ant=BB Prox=DD Ant CC Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End;

  29. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB R p AA BB L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=CC Ant=BB Prox=DD Ant CC Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End;

  30. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB R p X BB CC DD L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=CC Ant=BB Prox=DD Ant CC Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End; X := p^.prox;

  31. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB R p X BB CC DD L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=CC Ant=BB Prox=DD Ant BB Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End; X := p^.prox; X^.ant := R;

  32. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB R p X BB CC DD L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=DD Ant=BB Prox=DD Ant BB Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End; X := p^.prox; X^.ant := R; R ^.prox := X;

  33. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO Digite a Posição da Lista.: 3 F BB R p X BB CC DD L CC AA BB CC DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 003 Carlos 0 R$ 1800,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=DD Ant=BB Prox=DD Ant BB Prox=NIL R:= L; P:= L^.PROX; Cont := 1; While (cont < posi-1) do Begin r:= r^.prox; p := p^.prox; cont := cont + 1; End; X := p^.prox; X^.ant := R; R ^.prox := X; Dipose(p);

  34. LISTA DUPLAMENTE ENCADEADA – EXCLUSAO EM UMA POSICAO REGISTRO EXCLUIDO F BB L CC AA BB DD 001 Jose 0 R$ 1500,00 002 Antonio R$ 1000,00 004 Judite R$ 1000,00 Ant=NIL Prox=AA Ant=AA Prox=DD Ant BB Prox=NIL

More Related