(Solved):Stack operatorStack) { char op = operatorStack.pop(); int op1 = operandStack.pop(); int op2 = operandStack.pop(); if (op == ‘+’) operandStack.push(op2 + op1); else if (op == ‘-‘) operandStack.push(op2 – op1); else if (op == ‘*’) operandStack.push(op2 * op1); else if (op == ‘/’) operandStack.push(op2 / op1); } public static String insertBlanks(String s) { String result = “”””; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == ‘(‘ || s.charAt(i) == ‘)’ || s.charAt(i) == ‘+’ || s.charAt(i) == ‘-‘ || s.charAt(i) == ‘*’ || s.charAt(i) == ‘/’) result += “” “” + s.charAt(i) + “” “”; else result += s.charAt(i); } return result; } }

“…

 

Question

)

 

EXPERT ANSWER

+

We are so grateful for the pleasure of serving you and hope we met your expectations. Thank you. Manvila.

Scroll to top