[UCR]
[/\]

Universidad de Costa Rica
Escuela de Ciencias de la
Computación e Informática
[<=] [home] [<>] [\/] [=>]

InsertionSort()

(1) A[0].key := -;
(2) for i := 2 to n do begin
(3)      j := i;
(4)      while A[j] < A[j-1] do begin
(5)          swap(A[j], A[j-1]);
(6)          j := j-1
         end
    end
Aho, Alfred V.; Hopcroft, John E.; Ullman, Jefrrey D.
"Data Structures and Algorithms"; Addisson Wesley Publishing Co.; 1984.