Traversals

In this lesson, we'll look at the different ways that a BST can be traversed.

We'll cover the following

Knowing how to traverse a binary search will help in understanding graph traversals later on. Different types of traversals have different properties and use cases.

Even though you will not need to implement traversals over Binary Search Trees in competitions, this will be the basis for higher-level graph data structures.

We’ll go over three types of traversals over binary trees (not only BSTs) in general:

  • In-Order
  • Pre-Order
  • Post-Order

They differ in the order in which the left child, the right child, and the root are traversed recursively.

Get hands-on with 1200+ tech skills courses.