Linear Time Sorting
Linear Time Sorting
Counting-Based Algorithms
1. Counting-Based Sort:Counting-Based is a non-comparative
sorting algorithm. It counts the occurrence of each particular
element in the input array and uses this information to determine
the correct position of each element in the sorted output array.
Counting-Based sort assumes that the input elements are
integers or can be added to integers.
Radix-Based Algorithms
1. Radix Sort: Radix Sort is a non-comparison-basedsorting
algorithm that sorts elements by their numbers or characters. It
counts each number or sign in the elements from the least
significant number to the most significant Radical sorting
assumes that the input elements are integers or strings.
2. Bucket Sort:Bucket Sort is a variant of Radix Sort that divides
elements into fixed groups based on their range or distribution.
Each segment is sorted separately using a different sorting
algorithm or recursively bin-sort.
3. MSD (Most Significant Digit) Radix Sort: MSD Radix Sort is a
variant of radix sort that starts sorting elements based on their
most significant It recursively divides the elements into
subgroups based on the value of the current number and applies
MSD Radix Sort to each subgroup until all the numbers have been
counted.
4. LSD (Least Significant Digit) Radix Sort: LSD Radix Sort is
another variant that starts sorting elements based on their least
significant. It recursively sorts the elements based on each
number from rightmost to leftmost, producing a sorted result.
Both count-based and root-based sorting algorithms achieve
linear time complexity by exploiting specific properties of the
input elements, such as their range or representational structure
(e.g., numbers or characters). However, their applicability may
vary depending on the characteristics of the input data.