1.

Worst case complexity of Breadth First Search traversal __________(a) O(n*n)(b) O(nlogn)(c) O(n^2 logn)(d) O(n^3)The question was asked in my homework.Question is from Tree Traversal topic in portion Trees of Discrete Mathematics

Answer»

Correct CHOICE is (b) O(nlogn)

Easy explanation: In an n-ary binary TREE, we MUST have to visit all nodes from an adjacent node and repeat the same for next UNVISITED nodes. Hence, in worst case the TIME complexity should be O(nlogn).



Discussion

No Comment Found

Related InterviewSolutions