Numbers to node
tree = [ 0 for i in range ( n + 1 ) ] ; NEW_LINE tree [ 1 ] = 10 ; NEW_LINE tree [ 2 ] = 5 ; NEW_LINE tree [ 3 ] = 11 ; NEW_LINE tree [ 4 ] = 6 ; NEW_LINE tree [ 5 ] = 8 ; NEW_LINE dp1 = [ 0 for i in range ( n + 1 ) ] ; NEW_LINE dp2 = [ 0 for i in range ( n + 1 ) ] ; NEW_LINE dfs ( 1 , 1 , dp1 , dp2 , adj , tree ) ; NEW_LINE