takeUforward
Detect a cycle in Undirected Graph : Breadth-First Search - Tutorial