"tonyon boyo" wrote
i know how to print for bubble sort in python, is
there a way to print each pass in the sort so
i can see what happens at each step? thanks
Yes add a print statement inside the looop
that prints the list being sorted.
def bubblesort(list):
for passes in range(len
> i know how to print for bubble sort in python, is there a way to
> print each pass in the sort so i can see what happens at each step?
> thanks
A good first guess would be to try sticking "print list" in there in a
few different places.
Others will probably point out that "list" is a built-in
hello,
i know how to print for bubble sort in python, is there a way to print each
pass in the sort so i can see what happens at each step? thanks
def bubblesort(list):
for passes in range(len(list)-1, 0, -1):
for index in range(passes):
if list[index] < list[index + 1