public class Finder {
  static boolean seqLookup(String info, Node node) {
    if (node==null)
      return false;
    else if (node.info.equals(info))
      return true;
    else
      return seqLookup(info, node.left) ||
             seqLookup(info, node.right);
  }

  static boolean parLookup(String info, Node node, int p) {
    return seqLookup(info, node);
  }

  public static void main(String[] args) {
    boolean good= true;
    Node root=
      new Node(
        new Node(
          null,
          "shakira",
          new Node(null, "britney", null)),
        "christina",
        new Node(
          null,
          "nelly",
          new Node(
            null,
            "michelle",
            new Node(null, "shakira", null))));
    if (!parLookup("britney", root, 3)) {
      System.err.println("Sorry: britney belongs to the tree");
      good= false;
    }
    if (!parLookup("shakira", root, 3)) {
      System.err.println("Sorry: shakira belongs to the tree");
      good= false;
    }
    if (parLookup("madonna", root, 3)) {
      System.err.println("Sorry: madonna does not belong to the tree");
      good= false;
    }

    if (good)
      System.out.println("Good: your parLookup passed all tests");
  }

}
