Exercise 16. Bubble, Quick, and Merge Sort

You are now going to attempt to implement sorting algorithms for your DoubleLinkedList data structure. For these descriptions I’m going to use a “list of numbers” to mean a randomized list of things. This could be a deck of poker cards, sheets of paper with numbers on them, lists of names, or anything else you can sort. There are three usual suspects when you’re attempting to sort a list of numbers:

Bubble Sort This is most likely how you would attempt to sort a list of numbers if you knew nothing about sorting. It involves simply going through the list and swapping any out-of-order pairs you find. You continually loop through the list, swapping pairs, until you’ve gone through without swapping anything. ...

Get Learn More Python 3 the Hard Way: The Next Step for New Python Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.