|
-
February 6th, 2003, 10:33 AM
#2
Member
NULTRAX,
Doubt it. I had to do the same thing about two weeks ago for a coursework, which is what I assume yours is for...... Mmmmm.
Ok, a hint. You will need to create a class called BinarySearchTreeNode that looks something like:
public class BinarySearchTreeNode {
BinarySearchTreeNode left;
BinarySearchTreeNode right;
Object theDataObject;
public BinarySearchTreeNode (Object theDataObject) {
this.left = null;
this.right = null;
this.theDataObject = theDataObject;
}
}
You then need to think about how you will create the Insert method, which isn't too hard. The difficult part comes when you have to remove nodes from the tree.
<goodAdvice> If you use the above, then you MUST quote your source (not me, just say Antionline and give the address). It's good practice and prevents you being accussed of plagerism. </goodAdvice>
Good luck.
Regards,
T6286
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|