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