Skip to main content

Posts

Showing posts from June, 2022

Comparison Based Sorting VS Non-Comparison Based Sorting

  Comparison Based Sorting VS Non-Comparison Based Sorting   It may come as a surprise to many of you, but it's feasible to arrange or classify things without comparing them to one another. Instead, then making assumptions about the data they will sort, some sorting algorithms actually conduct the sorting without comparing the pieces. Non-comparison sorting is the method, and non-comparison-based sorting algorithms are the algorithms used. Counting sort, Radix sort, and Bucket Sort are examples of non-comparison sorting algorithms. Counting sort uses key-value sorting, while Radix sort examines individual bits of keys. Because they sort in O(n) time, these algorithms are sometimes known as Liner sorting algorithms. Since they have presumptions about the data, they can skip the comparison decision tree.   So, you can roughly divide the sorting algorithms into two types based on how they function: comparison-based, like QuickSort or MergeSort, and non-comparison-b...