binary tree width is given how to find its height?

33 views Asked by At

how to find the maximum and minimum height of a binary tree which has maximum width and N nodes?

my best guess is since when a tree has maximum width it means on each level it has maximum nodes. thus we can use the height when maximum nodes (full binary tree type since normal binary tree didnt work i tried) i.e (N-1)/2 but when i did apply this for an example say N=15, it doesnt satisfy that formula but rather the one for minimum height one which is floor(log(2^N+1)) why? (also this is my first time here and i have just started with data structures! sorry if this is a very basic question!)

0

There are 0 answers