IBM Interview Question

leetcode medium question like Binary Tree searching