About

I am too Lazy to update about me.

Role

Alma Mater:

B-tech in Computer Science
NIIT University, Neemrana
2015

Experience:

Application Developer
Wrappup Inc.
2016
Babytud
Answer
1 year 5 months ago

@ranita if a heap contains n elements, then at any single path from leaf node to root, the number of elements are logn. And since binary search takes O(logn) time so overall in a single path it would take O(loglogn) to search for an element. But this solution is not guaranteed as we can't just assume that our search element will always be in that single path only.

moreless
ranita's picture
Ranita Biswas

<div class="tex2jax">Oops...!! No one is following you.</div>

@ranita if a heap contains n elements, then at any single path from leaf node to root, the number of elements are logn. And since binary search takes O(logn) time so overall in a single path it would take O(loglogn) to search for an element. But this solution is not guaranteed as we can't just assume that our search element will always be in that single path only.

more less