Wednesday, April 2, 2014

Week 11: Sorting and Efficiency

This week we learned about sorting, which was also a topic on CSC108 and CSC165.

Before starting to discuss the different kind of sort, it is important to know that the focuses here is on the size of input, n. How does input size affect the time requires to produce output with different kind of sort (algorithm)?
Sometimes, the list might already be sorted, but what we care about more is the maximum steps (the worst case) require to sort a list. We call this big-O, or O(n), where in this case it means the maximum steps to sort the list with size n is n (or it runs no more than n steps).