> def selection_sort(lst,start,end):
> """sort the lst from selection start to end"""
> if len(lst)==1:
> return lst
> elif lst=="":
> return ""
> else:
> return lst[:start]+selection_sort(lst,start+1,end)
This doesn't appear to do any actual sorting?
And th
Usually, in case of doubt, use a debugger or print statements:
def selection_sort(lst,start,end):
"""sort the lst from selection start to end"""
print lst, start, end
if len(lst)==1:
print "list of size 1"
return lst
elif lst=="":
hello,tutors:
i am working on the recursion of selection sort,and my code is:
def selection_sort(lst,start,end):
"""sort the lst from selection start to end"""
if len(lst)==1:
return lst
elif lst=="":
return ""
else:
return lst[:start]+selection_sort(lst,start+1,en