Sorting Algorithms

(Still a work-in progress; I want to revisit with intuitive explanations and playing-card examples)


This is a companion discussion topic for the original entry at http://betterexplained.com/articles/sorting-algorithms/

INSERT???..

INSERT INTO…

i just want to ask… which of the following is the most efficient sorting algorithm? bubble sort, selection sort, insertion sort, merge sort or quick sort? i am humbly waiting for ur reply… thanx

Hi Mary,

Quicksort is a great general-purpose sort, and is typically the fastest. There are special cases where other sorts can be better (like merge sort or radix sort), but quicksort is usually the way to go.

which sorting technique are best& worst when array is sorted.

which sorting technique are best &worst when array is in reverse sorted.

Insertion sort works really well when the input is sorted or near sorted [linear time ] while quick sort is worst in such as case performing at O(n^2) …

Anyone more knowledgeable correct me if I’m wrong :slight_smile:

yes ,I agree with Insertion sort!!

I think when movements of the Elements in an Array are expensive or when the comparison of the Keys are
cheap , we can also use Selection Sort "!

I think that Radix Sort should(CAN) be a good choice for Linear Sorting .

pls.correct if I am wrong!

You are loosing your hair…

You are loosing your hair by the minute! Stop the Loss of hair…

shop for paxil…

If you want to shop for paxil you must check this website…

;

please tell which will be the best sort if number of swappings is the only criteria for its efficiency??

is it insertion sort?

Nice comparison of sorting algorithm en:

Writing midterm paper this short algoritm is very correct and exact.

which sort use less number of swappings

there is no most efficent . it is changing with your input

Among various these sorting techniques which is best in worst case?

Good work. Keep it up!

u Guys are realy Helpin us in our project

The worst case of heapsort is O(nlgn) and quicksort is O(n^2)…
why heapsort is not used frequently??