DataStructure Sorting techniques

+1 Rehman . · March 31, 2015
Can anybody suggest me material on "Sorting" which i can study from basis to skilled, and how much time is required to grasp the concepts ? if i give 2 complete days will it be enough ? i guess there are 3 types of sorting only (insertion/selection/bubble)

Post a Reply


Oldest  Newest  Rating
0 Dol Lod · March 31, 2015
There are multiple sorting techniques, many more than what you described. Here are the ones I know with a small description:

1)Bubble Sort: specfic implementation of h-sort n^2

2) H-Sort: uses shrinking radius comparisons to compare between elements until the elements you are comparing are only one apart. This description is terrible, but you essentially do comparisons between items i and i+h and then in the next round you reduce h until you are done. n^1.5

3) Selection Sort: This focuses on putting the smallest items in the front.  n^2
4) Insertion Sort : This means everything is properly sorted as you go through it. n^2
5) Quicksort: This uses a member of the collection to act as a separator and is nlogn.
6) Merge Sort: This splits arrays up by half every time. The two halves are then sorted and then recombined in order. nlogn
7) Tim sort: nlogn. Read wikipedia article: I feel like I don't understand enough of this particular sort to explain it very well.

If it helps I do have source code in C implementing most of these sorts. I ignored 1)h-sort and 2-Tim-sort. 
  • 1



Tell me what you like about the forum and what sucks about it here.

Bucky Roberts Administrator