Depth, height and subtree size for nodes of a nine-node binary tree

A binary tree holds nine nodes labelled A to I, with links as follows:

  • A is the root; its left child is B and its right child is C.
  • B has left child D and right child E.
  • C has no left child; its right child is F.
  • E has left child G and right child H.
  • F has left child I and no right child.
  • D, G, H and I have no children.

Measure depth and height in edges, so the root has depth 0 and every leaf has height 0. The subtree size of a node counts that node and all of its descendants. Fill in each value as a whole number.

NodeDepthHeightNodes in subtree
A
B
C
E
F

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors