Saturday, December 7, 2013

Sorting Algorithms and Efficiency

Sorting algorithms are kind of fun, especially when I took CSC108 and the lecturer showed us a youtube video of different sorting algorithms shown through folk dance. Computer scientists have a sense of humor!

In the second to last lab, we had to analyze different sorting algorithm times that showed how little changes in your code can make little or significant changes to runtimes. It was difficult for my partner and I to sometimes find these differences in the two different version of the code, however once we asked the TA for help it made more sense. Notably, I remember that for one of the sorting algorithms that the runtime was a lot quicker by using built-in Python functions in the code as opposed to explicitly writing it out. And this was also how I learned that inserting something in a list using Python built-in is done by going through the elements and shifting them down.

I tend to get confused with the different ways of sorting, and will definitely need to review the different ways as well as look over the implementation. One of the TAs mentioned that we should know some of the well-known function implementations of the sorts, but I wonder if we will need to know it for the exam. Probably.

It is also interesting to note that I am learning about runtime analysis in my other course CSC165 and it is interesting to note the significance of efficiency in computer science and that it is an important aspect in and of itself.