There is a cycle if an adjacent is visited and present in recursion call stack recur [ ]
else if ( visited [ adj [ v ] [ i ] ] == true && recur [ adj [ v ] [ i ] ] == true ) return true ; } recur [ v ] = false ; return false ; }