Synopsys Interview Question

asked me to do a tree traversal