title: Search a tree with three nodes?
body: <p>I can't seem to figure this out</p>
  
  <p>My tree nodes have the following 3 string fields and 3 node fields which are left, middle and right.</p>
  
  <p>This is what I have </p>
  
  <pre><code>public TreeNode findNode(String name) {
      TreeNode pointer = this.getRoot();
      if (!(name.equals(pointer.getName()))) {
          pointer = pointer.getLeft();
          findNode(name);
          pointer = pointer.getMiddle();
          pointer = pointer.getRight();
      }
      return pointer;
  }
  </code></pre>
  
  <p>I see that the problem is that I keep reseting the pointer to root with every iteration but I think that findNode should only intake string as it's parameter. I don't see a way to do this.</p>