Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions shiftHeaviest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def shiftHeaviest(givenList,index,tempIndex=0):
Return Value : None.
'''
#Approach : To swap the number to right if it is larger than the other number
# and recursively doing till it reaches to desired index.
# and recursively doing till it reaches to desired index.

if tempIndex!=index:
if givenList[tempIndex]>givenList[tempIndex+1]:
Expand All @@ -20,8 +20,7 @@ def shiftHeaviest(givenList,index,tempIndex=0):
else:
tempIndex=tempIndex+1
shiftHeaviest(givenList,index,tempIndex)
else:
return
return

def main():
'''
Expand Down