February 2014
Beginner
1248 pages
62h 25m
English
• The first iteration of insertion sort (p. 824) takes the second element in the array and, if it’s less than the first element, swaps it with the first element. The second iteration looks at the third element and inserts it in the correct position with respect to the first two elements. After the ith iteration of insertion sort, the first i elements in the original array are sorted.
• The insertion sort algorithm runs in O(n2) time (p. 827).
Read now
Unlock full access