Micro Focus interview question

Solve a binary tree exercise.