Pergunta de entrevista da empresa Microsoft

Write a function to check if a given binary tree is a valid binary search tree.