Sorting

This document has very good examples for applying the ideas of O notation to various sorting algorithms. The only problem is that the sample code is in Java. Thankfully, there’s not much to change! You can easily convert the Java code provided into C++ by doing the following: