What is the time complexity of balancing parentheses algorithm?

Q & ACategory: Data StructureWhat is the time complexity of balancing parentheses algorithm?
Admin Staff asked 4 years ago

What is the time complexity of balancing parentheses algorithm?
a) O (N)
b) O (N log N)
c) O (M log N)
d) O (N2)

1 Answers
Admin Staff answered 4 years ago

a) O (N)