Friday, 6 December 2013

Week 13 - Exam

As requested, this blog entry is going to be on the sorting algorithms - selection sort, quick sort, merge sort, and efficiency. 

My favourite sorting algorithm is quick sort, I especially like it because it's running time doesn't increase very much as the list gets very very large. I remember in class when we did the demonstration on the different sorting algorithms with different sized cups. All the cups looked the same size from where I was sitting. I remember in class when we did a head to head comparison of  some of the common different sorting algorithsm and quick sort was significantly better than the others.

In selection sort, you look at a list for the minimum value and switch it with the value at your current position. Selection sort has an efficiency of O(n^2).
In quick sort you choose a pivot point and compare it to the values in the list, moving the smaller values left of the pivot and larger values right of the pivot. This process is repeated recursively. Quick sorts efficiency is O(nlogn)
In merge sort, you take a list and divide it in halves, sorting these smaller halves and then merging the results together. Merge sort has an efficiency of O(nlogn).

This is my last slog entry, and with this I'm done the term work portion of the course and now it's time for the exam. Gonna watch some adventure time. Peace Johnny.

1 comment:

  1. Johnny here, your choice of favorite sorting method is respectable, however I on the other hand enjoy sorting by merging because I like cutting things in half, then sorting them and putting them back together. And instead of sorting you can put stuff together in different orders and create a mutant, its sick!

    Anyways good luck on the exam dirty steve, and dont forget your aid sheet

    ReplyDelete