Friday, April 4, 2014

Sorting and Efficiency

Last week in class we learnt about various sorting techniques. For example, quick sort is a sorting technique with log2n, you would choose a pivot ( you could pick a pivot at random), N steps each time so, 0(n)log(n). However, quick sort is slower when the list is already sorted, if its either ascending or descending, which is one of the major problems with quick sort. Another sorting technique would include Merge Sort, which essentially splits a list in half and merges the sort, it keeps splitting until you have one and one. There is also another form of sorting algorithms called Radix Sort, it is used when you have a limited range of data and that your values are integers. This sorting mechanism is alot more efficient than Count Sort, however, it is alot more complex than all the other sorting algorithms.

No comments:

Post a Comment