Chapter 11: Problem 3
Another sorting algorithm is bubble sort. Bubble sort involves keeping a sorted section at the end of the list. The list is traversed, pairs of elements are compared, and larger elements are swapped into the higher position. This is repeated until all element are sorted. a) Using the English description of bubble sort, write an outline of the bubble sort algorithm in English. b) Continue using top-down design until you have a Python algorithm. c) Turn it into a function bubble_sort(L). d) Write Nose test cases for bubble_sort.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.