Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure Insertion(L: in out Liste) is
- Cur,To_Sort,Next:Liste;
- begin
- if(Est_Vide(L) or Est_Vide(L.Suiv)) then return;
- end if;
- To_Sort:=L.Suiv;
- Next:=To_Sort.Suiv;
- while(not Est_Vide(Next)) loop
- if(L.Val>To_Sort.Val) then
- To_Sort.Suiv:=L;
- L.Suiv:=Next;
- L:=To_Sort;
- else
- Cur:=L;
- while(Cur.Suiv.Val<To_Sort.Val) loop
- Cur:=Cur.Suiv;
- end loop;
- To_Sort.Suiv:=Cur.Suiv;
- Cur.Suiv.Suiv:=Next;
- Cur.Suiv:=To_Sort;
- end if;
- To_Sort:=Next;
- Next:=To_Sort.Suiv;
- end loop;
- end Insertion;
- end listes;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement