620 views
0 votes
0 votes

1 Answer

0 votes
0 votes

1.From the give array(say size =n) , using min heap algorithm -> create a minheap

2.Take two minimum elements and merge them and place the result back in the array again apply minheap on the new array.

    Repeat step 2 for "n-1 " times .

Minimum number of comparisions required =n-1(Here its 5)

Related questions

2 votes
2 votes
2 answers
1
iarnav asked Mar 30, 2018
1,131 views
The minimum number of comparisons required to find the minimum and the maximum of 101 numbers is ________.When n is even then it's relatively easy, but how to deal with n...
1 votes
1 votes
1 answer
2
mystylecse asked Aug 15, 2017
3,483 views
The minimum number of comparisons required to find the minimum and maximum of 60 numbers is..............
0 votes
0 votes
1 answer
3
Siddhi Viradiya asked Apr 3, 2016
1,828 views
i cannot understand the following explanation..how solution is (3/2)n-2???If n is a power of 2, then we can write T(n) as:T(n) = 2T(n/2) + 2After solving above recursion,...
19 votes
19 votes
8 answers
4
piyushkr asked Dec 30, 2015
43,655 views
The minimum number of comparisons required to sort 5 elements is -4567