Proptiger Interview Question

Check if a binary tree is a binary search tree

Interview Answer

Anonymous

Dec 15, 2018

Simple enough, but I gave the wrong approach to start with where I just checked the left and right node values to be greater and less than the current node value. Once this was pointed out, I suggested the approach of checking the max value in the left tree and min value in the right tree, and the interviewer clearly stated that it was wrong approach. Eventually after the interview I figured out, though not efficient, it would still solve the problem.