Write a function to do a bubble sort on a list.

What will be an ideal response?


```
def bubbleSort(list):
done = false
while not done:
swapped = false
for i in range(1, len(list)):
if list[i-1]>list[i]:
iVal = list[i]
list[i] = list[i-1]
list[i-1] = iVal
swapped = true
if not swapped:
done = true
return list
```

Computer Science & Information Technology

You might also like to view...

What needs to be determined before an object-oriented program can be built?

Give a brief answer to each of the following “object think” questions:

Computer Science & Information Technology

A(n) ________ is typically used to display records from both tables, regardless of whether there are matching records

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which glass type is created by heating the glass, which gives it extra strength?

A. Standard B. Tempered C. Acrylic D. Laminated

Computer Science & Information Technology

You can modify transitions in Normal or Slide Sorter view. _________________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology