I have:
public void preOrderTrav() {
CustNode current = root;
Tree t;
printCustNode(current);
System.out.println(current.key + "," + current.name);
for (int i = 0; i < current.rentVid.size();
i++) { //Loop to add all videos in each node
System.out.print("," + current.rentVid.get(i));
if (current.left != null)
current.left.preOrderTrav();
}
}
HOwever obviously current.left.preOrderTrav(); won't work, since the above code is in a Tree.java.
How do I do an iterative of preOrderTrav() on the left Node?
FYI:
class CustNode {
int key; //Which is also the tel No since tel no is unique
String name;
Vector rentVid = new Vector();
CustNode left;
CustNode right;
}
This method is in the Tree.java. Other than this method, this Tree.java contains other methods which includes the insert, delete, findNode methods etc...
Let me know if more info is needed
