Microsoft interview question

iterating over an entrire tree