The time complexity to find a Eulerian path in a graph of vertex V and edge E is _____________

Việt Quân

New member
The time complexity to find a Eulerian path in a graph of vertex V and edge E is _____________
A. O(V$^{2}$)
B. O(V+E-1)
C. O(V+E)
D. O(E+1)
 
Answer: c
Explanation: An undirected graph has Eulerian Path if the following two conditions are true: -a) All vertices with a non-zero degree are connected. A graph of vertices with zero degrees don’t belong to Eulerian Cycle or Path, b) If two vertices have odd degree and all other vertices have even degree. Thus, the time to find whether a graph has a Eulerian path or not is O(V+E) with V vertices and E edges.
 

Tìm kiếm

Back
Top