2 2 votes closed with the note: Got it Consider the following two statements: P: There exists a comparison sort of 5 numbers that uses at most 6 comparisons in worst case. Q: Heap sort can be used as the auxiliary sorting routine in radix sort, because it operates in-place Choose appropriate option. P true, Q false Q true, P false Both P, Q are true Both P, Q are false Algorithms test-series sorting algorithms heap-sort radix-sort + – pankaj_vir 2.3k views comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments srestha commented Mar 20, 2018 reply Follow flag Auxiliary sorting of heap sort why not stable? 0 0 replyShare pankaj_vir commented Mar 20, 2018 reply Follow flag The auxiliary sorting routine in radix sort needs to be stable, meaning that numbers with the same value appear in the output array in the same order as they do appear in the input array. Heapsort is not stable. It does operate in place, meaning that only a constant number of elements of the input array are ever stored outside the array. 0 0 replyShare pankaj_vir commented Mar 20, 2018 reply Follow flag yes, option D is correct 0 0 replyShare Please log in or register to add a comment.
Best answer 0 0 votes P is False because of the number of leaves of a decision tree which sort $5$ numbers is $5!$ and the height of a tree is atleast $log(5!)$. We need atleast $7$ comparisons. Q is False because of auxiliary sorting routine in radix sort needs to be stable, meaning that numbers with the same value appear in the output array in the same order as they do appear in the input array. Heapsort is not stable. It does operate in place, meaning that only a constant number of elements of the input array are ever stored outside the array pankaj_vir answered Apr 4, 2018 • selected Apr 5, 2018 by pankaj_vir pankaj_vir comment Share Follow See 1 comment 1 1 comment reply Mohit Kumar 6 commented Apr 27, 2020 reply Follow flag can you explain about P statement in solution?how did you get 7.not getting? 0 0 replyShare Please log in or register to add a comment.