What is the smallest (largest) number of nodes in a heap of height 6? What is the height of a heap with 200 nodes?
guys how can ı found a solution for this question? if you have an answer can you explain step by step?(if this question have a formula pls write it)
Best How To :
Well, I assume you're talking about a binary heap data structure. That means that each step in the tree is going to have 2^n nodes in it. The total number of nodes in the tree is going to be 2^(n-1) + 1. A heap of height 6 is going to have 63 nodes. A heap with height 7 could hold 127 nodes. A heap with height 8 could hold 255 nodes. You'd need at least height 8 to hold 200 nodes. This sounds a lot like a homework question, so make sure you cite this so you maintain your academic integrity....