C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Linear Time SortingWe have sorting algorithms that can sort "n" numbers in O (n log n) time. Merge Sort and Heap Sort achieve this upper bound in the worst case, and Quick Sort achieves this on Average Case. Merge Sort, Quick Sort and Heap Sort algorithm share an interesting property: the sorted order they determined is based only on comparisons between the input elements. We call such a sorting algorithm "Comparison Sort". There is some algorithm that runs faster and takes linear time such as Counting Sort, Radix Sort, and Bucket Sort but they require the special assumption about the input sequence to sort. Counting Sort and Radix Sort assumes that the input consists of an integer in a small range. Bucket Sort assumes that a random process that distributes elements uniformly over the interval generates the input.
Next TopicCounting Sort
|