Introduction to array based binary trees


Let us look at a complete binary tree. We can see a pattern if we try to enumerate the nodes of a complete binary tree, starting from the root and going top to bottom, left to right.

Loading Image

Enumerating nodes of a complete binary tree

We can see that for any node n:

  • The left child = (2 * n) + 1
  • The right child = (2 * n) + 2

Liking the course? Check our discounted plans to continue learning.