Google interview question

Main: Tree, Time complexity Follow up: Binary Search