Which of the following are binary search trees?
Write the values printed by an in-order traversal of each of the following BSTs. What do you notice about the resulting sequences?
Draw the binary tree resulting from the following sequence of insertions:
Draw the binary tree resulting from the following sequence of insertions:
Implement the minimum
method in the following BST class, which finds the smallest value in a BST:
/** BST: a binary tree, in which:
* - all values in left are < value
* - all values in right are > value
* - left and right are BSTs */
public class BST {
int value;
BST left;
BST right;
/** Returns the minimum value in BST n.
* pre: n is not null */
public static int minimum(Node n) {
// your code here
}
}