This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 1 \ 2 \ 3 \ 4 \ 5 \ 6 \ 7 The BST that results from insertingn the values 4 3 5 2 6 1 7 in that order is: 4 / \ Page 1 of 2 BST Answers 2008/3/27 http://pages.cs.wisc.edu/~cs3671/topics/BinarySearchTrees/answers.html 3 5 / \ 2 6 / \ 1 7 Test Yourself #3 private static BinaryTreenode<K> smallestNode(BinaryTreenode<K> n) // precondition: n is not null // postcondition: return the node in the subtree rooted at n that // has the smallest value { if (n.left == null) { return n; } else { return smallestNode(n.left); } } Page 2 of 2 BST Answers 2008/3/27 http://pages.cs.wisc.edu/~cs3671/topics/BinarySearchTrees/answers.html...
View
Full Document
 Spring '06
 OnlineResources
 Tree traversal, Nested set model

Click to edit the document details