Check out a free preview of the full Tree and Graph Data Structures course

The "Tree Traversal" Lesson is part of the full, Tree and Graph Data Structures course featured in this preview video. Here's what you'd learn in this lesson:

Bianca introduces binary tree traversal by explaining what order nodes will be visited using the preorder traversal technique.


Transcript from the "Tree Traversal" Lesson

>> Bianca Gandolfo: We're gonna traverse through our tree, which requires us to understand how to loop through or traverse a data structure like a tree. Let's jump to that, here are our leaves. Let's just talk about traversing. There are different traversal techniques and it all has to do about which order we visit a node.

And we're going to start with something called preorder and it's gonna print the nodes like this. It's gonna start with the actual node itself. Then it's gonna do the left children, then it's going to do the right children, etc, like that. So there's the order, Q1, Q2, Q3, coffee, egg, bacon, toast.

So that's one order. There are many orders, but we'll start with this.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now