Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. procedure Insertion(L: in out Liste) is
  2. Cur,To_Sort,Next:Liste;
  3. begin
  4. if(Est_Vide(L) or Est_Vide(L.Suiv)) then return;
  5. end if;
  6. To_Sort:=L.Suiv;
  7. Next:=To_Sort.Suiv;
  8. while(not Est_Vide(Next)) loop
  9.  
  10. if(L.Val>To_Sort.Val) then
  11. To_Sort.Suiv:=L;
  12. L.Suiv:=Next;
  13. L:=To_Sort;
  14. else
  15. Cur:=L;
  16. while(Cur.Suiv.Val<To_Sort.Val) loop
  17. Cur:=Cur.Suiv;
  18. end loop;
  19. To_Sort.Suiv:=Cur.Suiv;
  20. Cur.Suiv.Suiv:=Next;
  21. Cur.Suiv:=To_Sort;
  22. end if;
  23.  
  24. To_Sort:=Next;
  25. Next:=To_Sort.Suiv;
  26. end loop;
  27. end Insertion;
  28.  
  29.  
  30.  
  31. end listes;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement