CS Interview Prep: Tree Traversal

janac
3 min readMay 21, 2020

Several interview questions are tree traversal questions in disguise.

Problems that can be solved with a…

Preorder traversal

  • Given a mind map, print a structured document
Preorder Traversal

Algorithm

The algorithm for preorder is as follows:

  • Print the root

--

--

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am senior software consultant at LazerTechnologies.com.