codeintuition-logo

Understanding the problem


Traversal for linear data structures is straightforward, as we only have to move in one dimension (either forward or backward). However, A binary tree is a non-linear data structure spread out in two dimensions, so we need to move in both dimensions. This is much more complex than just moving forward or backward.

Loading Image

Two dimensions to move in trees

Because we have two dimensions to worry about in trees, there can be many different ways to traverse a tree.

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