Sunday, March 23, 2014

Hints on Assignments and Sorts

Half of the portion of this week's lectures is focused on Assignment 2 Part 2. The prof used all of the monday class to provide substantial hints as to how the functions in regex_functions should be programmed. Some expressed dismay since they spent time beforehand figuring out what the code should be and then the prof tells the entire class about the solution, so they feel that their efforts are wasted since they could've just came to class and listened, and allocate the time they used to solve it on something else. However, personally, I think it is perfectly justified for the prof to give hints like he did in class, note that he didn't have such a session right after the assignment II is assigned but rather only three days before it is due. It is extremely helpful towards those who have thought heavily on the assignment over the past month and are still stuck due to a small issue; all they needed to finish their code are those few lines about the assignments on the prof's class sides. For some people it is not as if they have no idea how to code in python, but rather just a push to get them started.

On the second portion of the week, we looked at a few more kinds of sorts which perform significantly better than the ones we had before such as selection sort or insertion sort. The sorts we saw were quick sort and merge sort, they all require the partitioning of the list into smaller bits and call the code recursively to sort everything. The performance difference can be seen as the length of the list scales, the prof puts a timer in each of the code for all the sorts and merge sort comes out as the "best" sort using a fraction of the time as other sorts for list with long length. The focus of this week has been on the implementation of the merge sort, the prof using cards went through, step by step, each recursive step of a short list and translated it into python code giving the student some idea as to how these efficient sorts are programmed. In the second last week of school, I hope we can go into more details about the complexity of all the sorts and have a precise way in determining the big oh complexity of algorithms.

No comments:

Post a Comment