1.

What is the time complexity of balancing parentheses algorithm?(a) O (N)(b) O (N log N)(c) O (M log N)(d) O (N^2)I need to ask this question from Application of Stacks topic in portion Application of Stacks of Data Structures & Algorithms II had been asked this question by my college professor while I was bunking the class.

Answer»

The correct choice is (a) O (N)

For EXPLANATION: The TIME COMPLEXITY of balancing parentheses ALGORITHM is mathematically found to be O (N).



Discussion

No Comment Found

Related InterviewSolutions