+1 vote
in Data Structures & Algorithms I by (110k points)
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 I

I had been asked this question by my college professor while I was bunking the class.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
The correct choice is (a) O (N)

For explanation: The time complexity of balancing parentheses algorithm is mathematically found to be O (N).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.