Concept Flow - Cycle Detection in Undirected Graph
Start at any node
Mark node as visited
For each neighbor
If neighbor not visited
Recurse DFS on neighbor
Check cycle in recursion
If cycle found anywhere
Return True
No cycle found
Return False
Start DFS from any node, mark visited, explore neighbors. If a visited neighbor is not the parent, cycle exists.
