View Single Post
  #9 (permalink)  
Old 01-26-2008, 12:06 AM
gibsonrocker800's Avatar
gibsonrocker800 gibsonrocker800 is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
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,

Code:
//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) }
__________________
//Haha javac, can't see me now, can ya?
Reply With Quote