Insertion Sort
-
Insertion SortAlgoDS/Algorithm 2020. 1. 17. 19:13
1. Overview Insertion sort is a simple sorting algorithm that works the way we sort playing cards in our hands. It's one of the Greedy Algorithms. For nearly sorted data, consider that insertion sort is O(n) time. 2. Description 2.1 Procedure 12, 11, 13, 5, 6 Let us loop for i = 1 (second element of the array) to 4 (last element of the array) i = 1. Since 11 is smaller than 12, move 12 and inser..