codeintuition-logo

Structure of a binary tree


Now that we know how individual nodes of a binary tree look in the array implementation, let us look at how they link up together to form a binary tree. Multiple nodes link up together to create the binary tree structure. When implemented as an array, the node's enumeration in its tree representation is used as an index in the array where the data associated with that node is stored. 

Loading Image

Individual nodes arranged sequentially in an array

What looks like a tree on paper looks very different when implemented as an array in the computer memory. The resulting binary tree looks like a regular array of nodes in the memory. Let us look at what a binary tree implemented as an array looks like in the computer memory.

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