Converting Infix To Prefix Using Stack
Converting Infix To Prefix Using Stack
+, - 1 Left to right
*, / 2 Left to right
^ 3 Right to left
Example: Convert Infix (A+B)*(C-D) to Prefix
Step Action Stack Output
DC-BA
Scan: ) Pop until ( is found *
+