+1 vote
in Data Structures & Algorithms I by (110k points)
What is the time complexity of an infix to postfix conversion algorithm?

(a) O(N log N)

(b) O(N)

(c) O(N^2)

(d) O(M log N)

This is a very interesting question from Application of Stacks in portion Application of Stacks of Data Structures & Algorithms I

This question was addressed to me in unit test.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
Correct choice is (b) O(N)

The best I can explain: The time complexity of an infix to postfix expression conversion 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.