What is the time complexity of an infix to postfix conversion algorithm?
Show answerHide answer
Correct answer: (B) O(N²)
Explanation
Note: the answer key gives (B), but infix-to-postfix conversion scans each symbol once and pushes and pops each operator at most once on the stack, so it takes O(N) time.