Bifalgorithm post · Brisk · Chapter 1

What are the three ways to traverse a binary tree?

What are the three ways to traverse a binary tree? (Brisk · Chapter 1) — "There were two ways of traversing a graph: breadth-first, and depth-first. Curiously,…

Ideas in this flowchart

  • Graph and tree traversal methods
  • Graph traversal has two ways
  • Breadth-first traversal
  • Depth-first traversal
  • Tree traversal has three ways
  • Pre-order traversal
  • Post-order traversal
  • In-order traversal
  • All three tree traversals begin at the root
  • Each root child is considered a subtree
  • The traversals differ in the order of visitation
  • The first pre-order step is to visit the root
Feed/

What are the three ways to traverse a binary tree?

Channel

Brisk

1 page

"There were two ways of traversing a graph: breadth-first, and depth-first. Curiously, there are three ways of traversing a tree: pre-order , post-order , and in-order . All three begin at the root, and all three consider each of the root’s children as subtrees. The difference is in the order of visitation. To traverse a tree pre-order , we: 1. Visit the root."

Flowchart preview
Series cover
👍
0
0 comments0 shares

Sign in to view and post comments.