You are viewing a single comment's thread. Return to all comments →
Python 3 b=int(input()) a=[int(x) for x in input().strip().split(' ')] for i in range(1,len(a)): key=a[i] j=i-1 while j>=0 and a[j]>key: a[j+1]=a[j] j=j-1 a[j+1]=key print(*a)
Do let me know if there is more finer solution in python.
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 →
Do let me know if there is more finer solution in python.