codeintuition-logo

Understanding a generic binary tree


Now that we know how complete binary trees are implemented using arrays, let's try to understand how we can extend the same idea to any generic binary tree. Generic binary trees cannot be implemented using an array as easily as complete binary trees. This is because the implementation relies on some structural properties of a complete binary tree. Let us look at the problem we face when implementing a generic binary tree using arrays and how we can overcome it.

Understanding the problem

The problem here is pretty clear. To implement a binary tree using an array and be able to move around easily, the tree should follow some structural characteristic properties. The properties are given below.

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