data-structures-and-algorithms

data-structures-and-algorithms

View on GitHub

Insertion-Sort


BIG O_____


Solution

2: Compare the current element (key) to its predecessor.

3: If the key element is smaller than its predecessor, compare it to the elements before. Move the greater elements one position up to make space for the swapped element.


whiteboard proces