Stacks & queuesExplained
Infix to Prefix Conversion
Reverse, convert to postfix with swapped brackets, reverse again.
Time
O(n)
Extra space
O(n)
Use it for
Prefix (Polish) notation.
Reverse, convert to postfix with swapped brackets, reverse again.
Time
O(n)
Extra space
O(n)
Use it for
Prefix (Polish) notation.