retagged by
831 views
0 votes
0 votes

Can anyone explain each option, for every option if it is true then why? If false then why? (Please don’t comment like answer is A,B etc) Please help

retagged by

1 Answer

Best answer
6 votes
6 votes
  1. False ( Insertion sort can still take O(n^2) whereas merge sort takes less comparison )
  2. True.  Take the case of 2 3 4 5 1 there is at n inversion in this case. But it will lead to O(n) insertion sort comparison and O(n^2) comparison for quick sort (almost sorted case)
  3. False. Bubble sort will have O(n^2) comparison whereas in merge sort it is independent of it so again O(n*logn) [Check using above example 1st case 4 comparison then 3 then 2 then 1]
  4. False. Again heap always will have O(n logn) and insertion sort will take O(n)

This is my solution maybe I am wrong please feel free to correct me.

selected by
Answer:

Related questions

2 votes
2 votes
1 answer
1
0 votes
0 votes
1 answer
2
0 votes
0 votes
3 answers
3
1 votes
1 votes
2 answers
4
Ravi Dubey asked Aug 2, 2018
828 views
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.