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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started