You are viewing a single comment's thread. Return to all comments →
#python def runningTime(arr): shift=0 for i in range(1, n): while i-1>=0: if arr[i]<arr[i-1]: temp=arr[i] arr[i]=arr[i-1] arr[i-1]=temp shift+=1 i=i-1 else: break return shift
Seems like cookies are disabled on this browser, please enable them to open this website
Running Time of Algorithms
You are viewing a single comment's thread. Return to all comments →