Write a python function that will do bubble sort
Answer
def bubbleSort(list): needNextPass = True k = 1 while k < len(list) and needNextPass: # List may be sorted and next pass not needed needNextPass = False for i in range(len(list) – k): if list[i] > list[i + 1]:
OR
OR