256 views
0 votes
0 votes
If pointer to leaf node of max heap given, what is the time complexity to find smallest element?

1 Answer

0 votes
0 votes
Max heap  contains the element with the maximum value at the root and the smallest ones will be placed at the leaves.

As the pointer is already pointing to the leaf node, the finding operating will take O(1)  time  while one can argue the the removal operation may going to consume O(N)  amount of time.

Related questions

0 votes
0 votes
0 answers
1
Adiaspirant asked Jan 1, 2017
164 views
If pointer to leaf node of binary heap given, what is the time complexity to find smallest element?