Edges of the tree
graph [ 1 ] . push ( 2 ) ; graph [ 2 ] . push ( 3 ) ; graph [ 2 ] . push ( 4 ) ; graph [ 1 ] . push ( 5 ) ; dfs ( 1 , - 1 , 0 ) ; var u = 3 , v = 5 ; document . write ( findPrimeOnPath ( u , v ) ) ;