Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String infix = "3 > 4 && 4 <= 8";
- System.out.printf("infix: %s%n", infix);
- System.out.printf("postfix: %s%n", transformToRPN(infix));
- test("3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3", "3 4 2 * 1 5 - 2 3 ^ ^ / + ");
- }
- private static void test(String expected, String infix) {
- if (expected.equals(transformToRPN(infix)))
- System.out.println("test PASSED: " + infix);
- else
- System.out.println("test FAILED: " + infix);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement