It may have struck you that the Python solutions provided in the Cambridge A Level Computer Science Teachers Resource are rather clumsy and contain several errors.
This collection of Python versions of the Bubble Sort Algorithm has been battle-tested and is ready for error-free use.
You will notice that I have translated the CIE pseudo-code construct of
while True: # commands if condition: break
which I consider the best conceptual equivalent available in Python.
You can also easily use the code to create Bubble Sort practice questions such as:
"Suppose you have the following list of numbers to sort:
[19, 1, 9, 7, 3, 10, 13, 15, 8, 12]
What will the list look like after 3 passes of the bubble sort algorithm?"
I hope you find this resource useful. If so, please leave a positive review review to let others know.
It's good to leave some feedback.
Something went wrong, please try again later.
This resource hasn't been reviewed yet
To ensure quality for our reviews, only customers who have purchased this resource can review it
Report this resourceto let us know if it violates our terms and conditions.
Our customer service team will review your report and will be in touch.