Insertion Sort

Incrementally builds subarrays of length i = 1, 2, ..., N of the first i elements, and at the end of each iteration, that subarray will be sorted

Ex) 4 1 2 6 3

4

4 1 -> 1 4

1 4 2 -> 1 2 4

1 2 4 6

1 2 4 6 3 -> 1 2 4 3 6 -> 1 2 3 4 6

In [ ]: