Routine fastSort (A,n) is public Slot A ofType int[] -- array Slot n ofType int -- size Boxes i,j, gap, temp ofType int -- local -- Does extremely fast Shell insert Sort Set gap = n / 2 Repeat ExitOn (gap <= 0) Set i = gap Repeat ExitOn (i >= n) Set temp = A[i] Set j = i Repeat ExitOn ( (j < gap) or (temp >= A[j - gap]) ) Set A[j] = A[j - gap] Dec j by gap EndRepeat Set A[j] = temp Inc i by 1 EndRepeat Set gap = gap / 2 EndRepeat EndRoutine fastSort