MathWorks interview question

trees, recursion