can we directly say without this proof that we are doing logn work in upheapifying for n nodes so time complexity will be O(nlogn)
Build heap problem
hello @deepakjumani09,
heap is a complete binary tree and all complete binary tree are balanced tree ie their maximum height can never exceeds O(log(n) ).
check this ->
a)https://www.geeksforgeeks.org/height-complete-binary-tree-heap-n-nodes/?ref=rp
b)https://www.geeksforgeeks.org/relationship-number-nodes-height-binary-tree/
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.