This week we focus on sorting and the efficiency of coding. We touch on 4 kinds of sorting, which are quick sort, bubble sort, selection sort and insertion sort. All of them are used to put elements of a list in a certain order. Recursion can be used to help complete that process.
To evaluate the efficiency of coding methods, we learnt big O. Big O is an estimate of the worst case performance of a function assuming the algorithm will perform the maximum number of iterations. Algorithm that need to a longer running time will be considered less efficient.
For quick sort, big-O is nlgn, for the rest 3 sorting algorithm , big-O is n^2.
This week we start to read and think about assignment 3, and decided to choose option A. But still have no idea about it. Hope we can get some idea next week.
No comments:
Post a Comment