CMPT 127 Lecture Notes - Lecture 7: Pseudocode, Binary Search Algorithm, Sorting Algorithm
Document Summary
Description: in algorithm design, one of the first lessons is that the big-o the most important aspect: the slower the growth rate, the better the algorithm. But not all algorithms with the same growth rate are created equal; we have already seen several examples of this in class. In this question we will consider the growth rates of selection sort and insertion sort. Both sorting algorithms run in o(n2), but one is certainly more consistent in its running time than the other. This problem asks you to profile these two algorithms (given several constraints). Task: write your own c versions of selection sort and insertion sort, one function for each. The programmed functions must be based on the algorithms as given in class. Test that they work properly, and when you are satisfied that they are correct, you will profile each function using time() function in.