
Steven D. answered 12/10/20
PhD in Computer Science with teaching and tutoring experience
The tallest tree you can make just has one node on every level, so with 511 nodes, the highest you can get is 511 levels. The most nodes a tree can have on a single level is 2N-1 where N is the level. This gives 1 node on the first level, 2 nodes on the second level, and so on. A neat trick to remember about powers of two is that the sum of the first N powers of 2 is 2N+1-1. So if you sum up the nodes on the first N levels of a full binary tree, you get 2N-1 nodes. 511=29-1 So the shortest tree you can make with 511 nodes is 9 levels high.