IBM interview question

leetcode medium question like Binary Tree searching