0

I am studying for heap data structure and in my textbook, it says,

"bottom up heap construction is asymptotically faster than incrementally inserting n entries into an initially empty heap. Intuitively, we are performing a single downheap operation at each position in the tree, rather than a single up-heap operation from each. Since more nodes are closer to the bottom of a tree than the top, the sum of the downward paths is linear, as shown in the following proposition."

But, I am not sure how this is intuitive.

I searched single down heaps and single up heaps but I cannot really find the differences between those two and I cannot see the one is better than the other one.

Can someone clarify this, please?

Thank you

bdd0
  • 57
  • 5
  • Please check [this stack overflow answer](https://stackoverflow.com/a/36226805/1379817) for better clarification. Also consider going through the answers of [this stack overflow question](https://stackoverflow.com/questions/9755721/how-can-building-a-heap-be-on-time-complexity?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa). – biqarboy Mar 16 '21 at 15:51

0 Answers0