You are viewing a single comment's thread. Return to all comments →
Solution from my side (Python)
def insertionSort1(n, arr): for i in range(len(arr)-1): if(arr[i]>arr[i+1]): temp = arr[i+1] arr[i+1]=arr[i] arr[i]=temp for j in range(i+1): for k in range(j,i+1): if(arr[j]>arr[k]): temp = arr[k] arr[k] = arr[j] arr[j] = temp for num in arr: print(num,end=' ') print() else: for num in arr: print(num,end=' ') print()
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 2
You are viewing a single comment's thread. Return to all comments →
Solution from my side (Python)