# O(n**2) time | O(1) space
def insertionSort(array):
for i in range(1,len(array)):
= i
j
while j > 0 and array[j] < array[j-1]:
-1)
swap(array,j,j-= 1
j return array
def swap(array,m,n):
= array[n],array[m] array[m],array[n]
Insertion Sort
9,5,3,7,6,8,3,9,1,0,4,3]) insertionSort([
[0, 1, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9]