Ayush7614 / Daily-Coding-DS-ALGO-Practice

A open source project🚀 for bringing all interview💥💥 and competative📘 programming💥💥 question under one repo📐📐
https://daily-ds-algo.github.io/DS-Algo-Website/
MIT License
323 stars 474 forks source link

Detect cycle in an undirected graph #977

Open 19bce502 opened 3 years ago

19bce502 commented 3 years ago

AIM:

This is the GFG problem Medium Level Given an undirected graph with V vertices and E edges, check whether it contains any cycle or not.

Please Assign this to me under LGM SOC .

Details

We have to write the code which takes V denoting the number of vertices and adjacency list as input parameters and returns a boolean value denoting if the undirected graph contains any cycle or not.

Programming language

KishkinJ10 commented 3 years ago

I would like to provide the solution in c++ . I am a LGM-SOC participant

remote007 commented 3 years ago

@Saurabh4626 , @Ayush7614 I'd like to work on this issue in Python language. Under HCSSoC21 label. Time complexity : O(V+E) Space Complexity : O(V) where V is vertices and E is edges in the graph.