Bubble sort
Swap neighbours until the biggest values bubble to the end, and see its O(n^2) cost.
Lesson complete
Nice work. Replay it any time.
About this topic
Swap neighbours until the biggest values bubble to the end, and see its O(n^2) cost.
Part of Data Structures & Algorithms (C++): 27 topics, 5 free.