Intel Corporation Interview Question

Write production quality code to find whether a given binary tree is a BST or not. You can't make any global variable.