Microsoft interview question

Tree traversal