Pages 236-246 (Section 6.2)
Proof of Proposition 6.10 and 6.11 in
Consider a binary trees whose nodes contain integers.
We will call such a binary tree t a binary search tree
if for each internal node n of t
Write an algorithm that tests if a binary tree is a binary search tree.
all the integers stored in the left subtree of n
are smaller than or equal to the integer stored in n, and
all the integers stored in the right subtree of n
are greater than or equal to the integer stored in n.
Input: binary tree whose nodes contains integers
Output: Is t a binary search tree?