TimeComlexity and Space Complexity of Eulerian Cycle

Hi,

Please clarify, if this is correct.

Time Complexity of Eulerian Cycle: O(n cube)
// Because, for the number of edges for a vertex, it is n c 2 --> n(n-1)/2 -> O(n square)
// If we do it for all the vertices then it will be n * O(n square) --> O(n cube)
// For a eulerian cycle, we iterate through all the edges to check if it is odd or even count.

Space Complexity of Eulerian Cucle: O( |V| +| E|) --> To store all the vertices and corresponding edges.

Comments (0)