This preview shows pages 1–2. Sign up to view the full content.
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
This note was uploaded on 03/27/2008 for the course MATH 211 taught by Professor Onlineresources during the Spring '06 term at Wisconsin.
 Spring '06
 OnlineResources

Click to edit the document details