1.

What is the time complexity for finding a Hamiltonian path for a graph having N vertices (using permutation)?(a) O(N!)(b) O(N! * N)(c) O(log N)(d) O(N)

Answer» Right choice is (b) O(N! * N)

To explain: For a graph having N vertices traverse the permutations in N! iterations and it traverses the permutations to see if adjacent vertices are connected or not takes N iterations (i.e.) O(N! * N).


Discussion

No Comment Found