Skip to main content
2 of 2
clarified according to comments
ryan
  • 4.5k
  • 1
  • 15
  • 41

If it is a full binary tree, that is defined as:

Full binary tree is a tree in which every node other than the leaves has two children.

Then you know the depth $D$ will be half of the total possible diameter. This is because we can take a maximum possible path of length $D$ from root to any leaf in the subtree rooted at the left-child of the root, and we can also take a maximum possible path of length $D$ from root to any leaf in the subtree rooted at the right-child of the root. Thus, adding these up would be a path of length $2D$.

Thus, we get that the maximum possible diameter would be equal to twice the depth (i.e. $\mathrm{diameter} = 2\cdot \mathrm{depth}$).

ryan
  • 4.5k
  • 1
  • 15
  • 41