Binary Search Tree help for assignment?
So I'm given an assignment where I have 2 files that contain integers, I make a BST with the first file and use the 2nd file to compare its integers with that of the integers in the search tree. I am basically given the client code, the interface, and some of the binarynode class and some of the searchtree class. I need to build the tree with a buildtree method that is passed the filename from the client code. This is my issue so far.
I don't quite understand how to build the tree this way, I want to make the BuildTree method recursive, but how can I do that if its only parameter is the filename? I started doing it with a while loop using hasNext() as the condition, but I'm running into issues traversing the tree with just a loop. I can post the code if necessary.
Posted Dec 2, 2011, 3:28 AM UTC · edited