import java.util.*; public class Postfix{ static int precedence(char ch) //function to get the precedence { switch(ch){ case '+': case '-': return 1; case '*': case '/': return 2; case '^': return 3; } return -1; } static String converter(String exp){ String result = new String(""); Stack sk = new Stack<>(); for(int i=0; i