Lesson+tasks+2016-Oct-19

Lesson tasks for 2016 Oct 19

1. Study Merge sort algorithm Please fill-in the related part of the handout ,, , , Reference: Interactive python code running for tracing the implementation of each step! Please click on RUN and SHOW CodeLens and run the code step by step. http://interactivepython.org/runestone/static/pythonds/SortSearch/TheMergeSort.html?highlight=merge%20sort

2. Study Quick sort algorithm Please do a trace-table of the quick sort algorithm for the list: [9 2 4 5 6 1 3 8 7] ,, Reference: Interactive python code running for tracing the implementation of each step! Please click on RUN and SHOW CodeLens and run the code step by step. http://interactivepython.org/runestone/static/pythonds/SortSearch/TheQuickSort.html?highlight=quick%20sort

3. Implement merge sort and quick sort in python You can refer to the above two links, but please DO WRITE THE CODE BY YOURSELF after you've understood it!

4. Analyze about the time complexity for the 5 algorithms: bubble, insertion, selection, merge and quick sort. Code template for running time test.

AT THE END OF THE LESSON, YOU SHOULD SUBMIT the following to your project page. 1. a plot with running time v.s. length of the list for all 5 algorithms 2. all the code you've written for the above task

5. Get ready for your major 2 next week, which is about: sorting algorithms, OOP and data structures ( lesson content on Friday).