Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Procedure Tri_Ins (Var t: TAB; n: integer);  
  2. Var aux,i : integer;  
  3. begin  
  4.         If n > 1 Then  
  5.              begin  
  6.                   Tri_Ins (t,n - 1);  
  7.                   If t[n] < t[n - 1] Then  
  8.                   Begin  
  9.                      aux:= t[n];  
  10.                      i := n;  
  11.                      Repeat                          
  12.                         t[i] := t[i - 1];  
  13.                         i := i - 1;  
  14.                      Until (i = 1) Or (aux > t[i - 1]);  
  15.                      t[i] := aux;  
  16.                   End;