Question: Could someone correct my mistake in my Java code? The following code is used to convert an infix expression to a prefix expression, however, when
Could someone correct my mistake in my Java code?
The following code is used to convert an infix expression to a prefix expression, however, when parentheses are introduced in the expression, I receive an incorrect expression as an output as well as an occasional "null" within the expression. Like: /+(null(null452
(Link to a pastebin of the code to help) https://pastebin.com/raw/5EL38c61
// takes an infix expression and returns prefix form of the infix // expression private static String infixToPrefix(String infix) { Stack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
