*/
    BSTNode insert(BSTNode tree, K key, V value) {
	// Special case: Empty tree. Build a new node.
	if (tree == null) {
	    return new BSTNode(key, value);
	} // if (tree == null)
	else {
	    int tmp = order.compare(key, tree.key);
	    if (tmp == 0) {
		tree.value = value;
		return tree;
	    } else if (tmp < 0) {
		tree.smaller = insert(tree.smaller, key, value);
		return tree;
	    } else {
		tree.larger = insert(tree.larger, key, value);
		return tree;
	    } // if the key is larger than the key at the node
	} // if the tree is nonempty
    }