daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Oct 20th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure TableSort (T: in out Table_Array) is
  2.    
  3.     X: Item;
  4.     J: Index;
  5.            
  6. begin
  7.        
  8.     for I in Index'Succ(T'First)..T'Last loop
  9.         if T(I) < T(Index'Pred(I)) then
  10.             X := T(I);
  11.             T(I) := T(Index'Pred(I));
  12.            
  13.             J := Index'Pred(Index'Pred(I));        
  14.            
  15.             while J > Index'Pred(T'First) and X < T(J) loop     --hiba lehet
  16.                 T(Index'Succ(J)) := T(J);              
  17.                 J := Index'Pred(J);
  18.             end loop;                      
  19.            
  20.             T(Index'Succ(J)) := X;
  21.            
  22.         end if;    
  23.     end loop;
  24.    
  25. end TableSort;
RAW Paste Data
Top