JM Techmind interview question

How to traverse a tree