Friday, November 29, 2013

Sorting Algorithms


November 29, 2013

TOPIC(s): Listed Above

Over the course of this semester and past year of learning programming, all sorts of new concepts and ideas were introduced, some not so easily as the others. If there was any particular area I was lacking until now, it was in the analysis of algorithm analysis. Thankfully, with the help of the professor, students, and student posts on Piazza I was able to understand this concept better compared to when I first was introduced to it earlier this year.

Sorting algorithms were one of those areas where in terms of both concept and code I had trouble at first. The types the class took a look into were the ever so familiar selection and insertion sort, and as well as some new one such as merge and quick. Out of the ones which I had most confusion on at first was quick sort, where instead of the usual finding an element in a list and doing various comparisons, the algorithm (much like merge sort) took the list and separated it into three elements, a list before the chosen pivot value, and a list after the pivot. It was taking a look after the code with recursion which helped in clarity of the quick sort.

The merge sort on the other hand I found interesting in terms of concept and the code. In concept the list would continually keep breaking down in half until essentially there is one element in new lists, sort itself, and combine with other nearby lists and do the same sorting. In terms of efficiency, I realized that with all the recursive calls called in Abstract way, in terms of sorting large item lists the efficiency would become relatively slow.

With these in mind, it still awes me to wonder how people could come up with many different ways of searching through and sorting through a list. On top of the learned and new methods in this class, there is also the built-in, which is noticeably the fastest in efficiency out of all the sorting algorithms available.


No comments:

Post a Comment