Re: [algogeeks] Soritng

2011-11-22 Thread Prem Krishna Chettri
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

[algogeeks] Soritng

2011-11-20 Thread kumar raja
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