Ahh thanks for the help CaptainMorgan. Unfortunately i got a question like this on my test today, I think i might have gotten it right. The test was kinda difficult. The 40 multiple choice questions were okay, i got most of em right. As for the free-response. Those were really hard. I did alright on them but not as great as i thought i would. See my problem is that i can't understand what the AP questions ask. And of course they have to set up a class structure for you. I would much rather them to tell me to write a program that does something, and thats it. I like setting up my own structures.
One of the questions was an implementation of a binary search tree. I had to write the peekMin method. basically what i did was,
//Make a new node that is the same as the root since we are
//going to change it.
TreeNode newNode = new TreeNode(root, root.getValue());
while(newNode.getLeft() != null)
{
//I can't remember exactly what i wrote
//Something along the lines of continually going to the left
//Then, when we reach the bottom node (since the bottom leftmost
// node is the smallest which is what we are looking for, return this node)
}