Driver code
public static void main ( String [ ] args ) { int N = 3 ; int [ ] [ ] adj = { { 0 , 1 } , { 1 , 2 } } ; graph = new ArrayList < > ( ) ; for ( int i = 0 ; i < MAX ; i ++ ) graph . add ( new ArrayList < > ( ) ) ; countSubtrees ( N , adj ) ; } }