Marco

Marco

  • NA
  • 59
  • 0

iterator on a Tree

Nov 15 2007 4:40 AM
class Node {
   private int value;
   public Node (int i) {value=i;}
   Node Left;
   Node Right;
   Node Parent;
}

class BinaryTree {
   private Node root;
   public Tree { root = new Node());
   //other
}

Assuming the two class are wrote right; I'm looking a way two write an Iterator on the tree (ie an iterator that go down on the nodes of the Tree). Is there a way? How to write it?
thank you.

Answers (1)