# Detect Cycle in a Undirected Graph

Posted: 17 Mar, 2018

Difficulty: Hard

#### Given an undirected graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least one cycle, else return false.

##### Input format :

```
Line 1 : Graph of type graph class
```

##### Output Format :

```
return true or false
```

Working on approaches!

Meanwhile, please head to Code Editor and try the problem there.

Meanwhile, please head to Code Editor and try the problem there.

SIMILAR PROBLEMS

# Get DFS Path

Posted: 22 Jul, 2021

Difficulty: Easy

# Get Path using BFS

Posted: 22 Jul, 2021

Difficulty: Easy

# Bellman Ford

Posted: 23 Jul, 2021

Difficulty: Moderate

# Floyd Warshall

Posted: 23 Jul, 2021

Difficulty: Moderate

# Collect Maximum Coins in Matrix

Posted: 29 Oct, 2021

Difficulty: Moderate