Challenge: Prefix to Postfix Conversion
Convert a prefix expression to a postfix expression.
We'll cover the following
Problem statement
In this challenge, write a function postfix(prefix)
that takes a prefix expression as prefix
, converts it to a postfix expression using a stack, and then returns it.
-
Prefix expression: An expression in which the operator appears before the operands.
-
Postfix expression: An expression in which the operator appears after the operands.
For example, if we have an expression , then its prefix expression would be , and its postfix expression would be .
Get hands-on with 1400+ tech skills courses.