GeeksforGeeks » GPuzzles

please solve this sorting questions

(4 posts)
  1. @armada
    Member
    Posted 9 months ago #

    can it be possible to sort 6 numbers with help of 9 comparison using comparision sorts only?
    like numbers are 6 3 2 5 4 1 or in any order?

  2. ksdeol
    Member
    Posted 9 months ago #

    no. u can't because to sort 6 numbers we require minimum 10 comparison..

  3. bharat
    guest
    Posted 4 months ago #

    I think with quick sort we can do ...
    number of comparisons are nlogn = 6*log(6) = [9]

  4. bharat
    guest
    Posted 4 months ago #

    Sorry for previous reply .....


Reply

You must log in to post.

RSS feed for this topic