Hello, I would like some help to do a search on a graph and check if it satisfies the euler theorem.
Theorem says: " A connected graph will contain an Euler cycle if, and only if, each of the vertices has an even number of edges falling on it.
Then the problem comes down to finding out the degree of each vertex in my graph, and whether it is connected.
I thought of representing my graph through an adjacency list, because as each vector will have the list of neighbors, just ask for its size minus one and get the degree of the vertex. To find out if it is connected I thought of using a DFS so that I can check as much as possible of each of my neighbors in the graph.
What other ways can I optimize my solution suggestion?