Here listed above is my question above and example of how it would be done is be
ID: 3850955 • Letter: H
Question
Here listed above is my question above and example of how it would be done is below. I need this coded in Java as an example. This is a warm up for me to understand the project I will be diving in. The code should be fairly simple but I just do not understand it.
Edit* ignore the polish notation comment I want the output to be like I had noted below.
Thank You
Explanation / Answer
//ExpressionValidate.java import java.util.Stack; public class ExpressionValidate { public static String validateExpression(String expr) { char r[] = expr.toCharArray(); char s[] = expr.toCharArray(); Stack st = new Stack(); int i = 0; while (i 0) { System.out.println("Something is wrong!!"); } else if (s[i - 1] != ')' && top > 0) st.pop(); i++; } } StringBuffer result = new StringBuffer(); for (i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.