Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TableSort ( T: in out Table_Array) is
- x : Item ;
- j: Index;
- begin
- for I in T'Range loop
- if T(Index'Succ(I)) < T(I) then
- x := T(I) ;
- T(I) := T(Index'Succ(I));
- j := Index'Pred(Index'Pred(I));
- while j <= T'First and x < T(Index'succ(j)) loop
- T(j) := T(Index'Succ(j)) ;
- j := Index'Pred(j);
- end loop ;
- T(Index'Pred(I)) := x ;
- end if ;
- end loop;
- end TableSort ;
Add Comment
Please, Sign In to add comment