Validate Binary Search Tree and valid palindrome