Comparison based sort.

closed account (zwpL3TCk)
Hi, Im just wondering what is the difference between comparison based sort with other sorting algorithms like bubble sort, merge sort and selection sort. Or can you give me an example of comparison based sort? An array with 3 elements.
Last edited on
difference between comparison based sort with other sorting algorithms like bubble sort, merge sort and selection sort.
bubble sort, merge sort and selection sort are comparison sorts.

Any sorting algorithm where you compare element to other element to determine their order is comparison sort.

An example of non-comparison sort would be counting sort, radix sort or bucket sort.:
http://opendatastructures.org/ods-java/11_2_Counting_Sort_Radix_So.html
https://en.wikipedia.org/wiki/Bucket_sort
Last edited on
closed account (zwpL3TCk)
Hi! Thank you for your reply. So if i want to create a program using array to compare elements to place them in their order i can use Bubble sor, Merge sort and selection sort?
Or insertion sort, or quick sort, or introsort, or heap sort, or shell sort, or comb sort...
closed account (zwpL3TCk)
Thank you! It helps me :)
Topic archived. No new replies allowed.