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.
for graph with edges
(0,1);(1,2);(0,3);(3,4);(0,2)
Sample Output 1:
True