MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Method main

Java/Stack/InfixToPrefix.java:5–9  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

3
4public class InfixToPrefix {
5 public static void main(String[] args) {
6 System.out.println("1+2+3 -> " + infix2Prefix("1+2+3"));
7 System.out.println("A^B-(C+D) -> " + infix2Prefix("A^B-(C+D)"));
8 System.out.println("(P/L+(F*J) -> " + infix2Prefix("(P/L+(F*J)"));
9 }
10 public static String infix2Prefix(String expression){
11 if(!BalancedBrackets.isBalanced(expression)) return "Invalid Expression";
12 Stack<Character> operatorStack = new Stack<>();

Callers

nothing calls this directly

Calls 1

infix2PrefixMethod · 0.95

Tested by

no test coverage detected