Synopsys interview question

asked me to do a tree traversal