recategorized by
2,230 views
1 votes
1 votes
Consider a binary min heap containing n elements and every node is having degree 2 ( i.e. full binary min heap tree). What is the probability of finding the largest element at the last level ?

According to my understanding the largest element has to be a leaf and since leafs can be on two levels last and second last therefore the probability should be 1/2
recategorized by

2 Answers

1 votes
1 votes
By Constructing a min Heap , we can say that the maximum element can be any where in the last level.
There is not any possibility that any internal node contains the maximum element.
So probability of getting maximum element at leaf level is 1.
0 votes
0 votes
there is ambigutiy...

if leaf is in 2 levels than p=0.5 and if it is in last level p=1...that depends on value of n.

Related questions

2 votes
2 votes
1 answer
1
Rishav Kumar Singh asked Jun 15, 2018
2,901 views
Which data structure is most efficient to find the top 10 largest items out of 1 million items stored in file?AMin heapBMax heapCBSTDSorted array
11 votes
11 votes
5 answers
2
Vikrant Singh asked Dec 28, 2014
3,710 views
What is the complexity of finding $50^{th}$ smallest element in an already constructed binary min-heap?$\Theta(1)$$\Theta (\log n)$$\Theta (n)$$\Theta (n \log n)$
0 votes
0 votes
1 answer
3
rsansiya111 asked Dec 18, 2021
394 views
1 votes
1 votes
0 answers
4
codingo1234 asked Nov 20, 2018
1,293 views
Consider a binary min heap given below containing integer in [1, 15]. The maximum number of node movement on 5 successive removal of element are ________.