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. - http://slides.com/bgando/intro-graph-trees

Get Unlimited Access Now

Transcript from the "Tree Traversal" Lesson

[00:00:00]
>> 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.

[00:00:30] 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.

[00:01:02] So that's one order. There are many orders, but we'll start with this.