c++ solution to Validate Binary Search Tree