// AP Computer Science, AB Exam, 1996, Question 3, part B in C++ bool IsBST(TreeNode * t) // postcondition: returns true if t represents a binary search // tree containing no duplicate values; // otherwise, returns false. { if (t == NULL) return true; // empty tree is a search tree return ValsLess(t->left,t->info) && ValsGreater(t->right,t->info) && IsBST(t->left) && IsBST(t->right); }