Edges of the tree
graph [ 1 ] . append ( 2 ) NEW_LINE graph [ 2 ] . append ( 3 ) NEW_LINE graph [ 2 ] . append ( 4 ) NEW_LINE graph [ 1 ] . append ( 5 ) NEW_LINE dfs ( 1 , - 1 , 0 ) NEW_LINE u = 3 NEW_LINE v = 5 NEW_LINE print ( findPrimeOnPath ( u , v ) ) NEW_LINE