Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Preorder Traversal

I am reading the blog post on preorder traversal of binary tree and I am having trouble understanding the recursive approach. Can someone please explain it in more detail?

In particular, I am confused about the following steps:

  1. Why do we first call the root of the current tree?
  2. What does it mean to "recur on the left subtree"?
  3. What does it mean to "recur on the right subtree"?

I would appreciate any help you can provide.

Sign In or Register to comment.