Question 1
Question 2
Test Yourself #1
(1) (2) (3) (4)
A 10 cat 15
/ \ / / \ / \
B C 5 bat rat 5 22
/ / \ \
-3 ant 20 30
Tree 1 is not a BST because B is greater than A, yet B is in the left
subtree of the node with key A (all keys in a node's left subtree should
have keys that are less than the key in that node).
Tree 4 is not a BST because 20 is greater than 15, yet 20 is in the left
subtree of the node with key 15.
An inorder traversal of a BST visits the nodes in sorted order.