Convert Infix To Prefix Notation
Difficulty: Medium
Acceptance: %
Points: 30.00
You are given an infix expression as a string s and need to convert it into a postfix expression.
- Infix Expression: This is the standard mathematical notation where operators are placed between operands, e.g., a op b (e.g., a + b).
- Postfix Expression: This is a format where the operator follows the operands, e.g., a b op (e.g., a b +).
Note: Follow the operator precedence:
- ^ has the highest precedence.
- * and / have equal precedence, which is higher than + and -.
- For simplicity, ignore the right associativity of ^.
Expected Time Complexity: O(n)
Expected Auxiliary Space: O(n)
Companies: Microsoft Visa Paytm
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.