storing the path from root to node
static void dfs ( int cur , int prev , int pathNumber , int ptr , int node ) { for ( int i = 0 ; i < tree [ cur ] . Count ; i ++ ) { if ( tree [ cur ] [ i ] != prev && ! flag ) {