Graphs 14 : Cycle Detection in Undirected Graph using DFS

may be implement part condition if(neigbour!=parent) is wrong
according to me if(neigbour!=node)
this condition must come

@khemchandrs if(neighbour!=parent) is correct. Please watch the video again from 9th minute. Prateek bhaiya has clearly explained that condition with an example.