A tree node structure
public class Node { public int data ; public Node left , right ; public Node ( int data ) { this . data = data ; this . left = this . right = null ; } } class Pair < T , V > { public T first ; public V second ; public Pair ( ) { } public Pair ( T first , V second ) { this . first = first ; this . second = second ; } }