This week in class we discuss sorting. Some students may have been confused as to why we're discussing something we talked about in csc148, but I knew where this was going. Sorting is a little more complicated than most people think it to be. It's not just about getting the job done, it's about efficiency.
We discussed how different types of sorts have different runtimes. We discussed the runtimes of sorts like bubble, insertion, selection, quick and merge. We noted that in many scenarios quick and merge sort have on average better runtimes than the others with nLogn, where n represents the length of the list. This is because sorts like merge and quick recursively iterate through sorting, allowing for cutting down the amount of work it has to complete. I actually have a lot of experience with these types of sorting algorithms from high school where we had a huge section of our curriculum based around it. We even got to watch a very interesting (and boring) video called sorting out sorting, where it just races a whole bunch of different sorting algorithms. Can you guess who won? You guessed right, quicksort, with tree insertion and heap sort following closely behind. But I'll get more into that next week, when I'm forced to write about sorting.
No comments:
Post a Comment