@prashant_9915
The condition is not as you have written. The visited[i] is checked to be false , not true.
if((visited[i] == false && cycle_detection_dfs_helper(i,visited,is_cycle))|| is_cycle[i] == true)
or simply
if((!visited[i] && cycle_detection_dfs_helper(i,visited,is_cycle))|| is_cycle[i] == true)
The reason for the first condition - !visited[i] && cycle_detection_dfs_helper(i,visited,is_cycle)
is to check whether the current branch emerging from ith child node results in a cycle later. If so , we obtain true from it and return true to the parent call as well since this is a recursive function. Without this condition , we would not be able to pass the result from future result back to our parent call. Hence the need for this condition.