This is a Great Question ..
Answering My Opinion as Follows :- 1> Its QuickSort :- Coz we compare on the basis of pivotal element so , we are reducing half (or More ) of the total comparison by picking the the pivot as a bench mark. All rest of the sorting do the full element comparison. 2> Its Selection Sort :- coz we swap picked up element only when we are sure when I need to place it. 3> Sorry I didn't get the question properly as I am not aware of this cost related information. Thanks for sharing this question. On Mon, Nov 21, 2011 at 11:34 AM, kumar raja <rajkumar.cs...@gmail.com>wrote: > > if we have set of n elements then > > 1) which sorting method uses least number of comparisons?? > > 2) which sorting method uses least number of swaps?? > > 3) suppose the array is 2 8 4 6 5 9 > if we want to swap 8 and 5 the cost is 2(5-2)=6 .here 5 and 2 are > indices of 5 and 8. > so what sorting method minimizes the cost, i want the answer in general > case ,not for this particular array. it is also called least distance > sorting > > -- > Regards > Kumar Raja > M.Tech(SIT) > IIT Kharagpur, > 10it60...@iitkgp.ac.in > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.