Pregunta de entrevista de Proptiger

Check if a binary tree is a binary search tree

Respuesta de la entrevista

Anónimo

15 de dic de 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.