MathWorks interview question

How do u traverse a tree level wise