This preview shows page 1. Sign up to view the full content.
Unformatted text preview: y ]= x . (Hint: do this problem in 3 steps. First show that y must be an ancestor of x by eliminating the possibility that it is either a descendent of x or a cousin of x ; second, show the same thing for left[ y ]; third, show by contradiction that there is no ancestor of x which is lower than y , and which has the same properties. All steps boil down to a careful application of the BST properties.) 3. (1 Point) Insert the following keys (in order) into an initially empty Binary Search Tree, and draw the BST structure that results: 26, 41, 47, 17, 14, 30, 10, 38, 28, 21, 19, 12, 16, 39, 23, 20, 15, 7, 35, 3. Determine an assignment of colors Red and Black to the nodes in this tree so as to satisfy the RedBlack Tree properties. 4. (1 Point) 13.15 Show that the longest simple path from a node x in a redblack tree to a descendant leaf has length at most twice that of the shortest simple path from node x to a descendant leaf....
View Full
Document
 Spring '09
 AgoreBack
 Binary Search

Click to edit the document details