Skip to main content

Posts

Featured

POSTFIX EXPRESSION EVALUATION

JAVA PROGRAM TO EVALUATE A POSTFIX EXPRESSION USING STACK. COMPUTER GENERATED OUTPUT IS: CODING: import java.io.*; class postfix { int A[];int top,size; postfix(int n) {top=-1;A=new int[n];size=n; } void push(int ch) { if(top==size-1) System.out.println("Overflow"); else {top++;A[top]=ch; } } int pop() { if(top==-1) return(-99999);int ch=A[top]; if(top==size-1) top=-1; else top--; return(ch); } public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the post fix expression"); String s=br.readLine();postfix ob=new postfix(s.length()); System.out.println("Enter values Of\t:"); for(int i=0;i<s.length();i++) { char ch=s.charAt(i); if(ch!='*'&&ch!='^'&&ch!='+'&&a

Latest Posts

NUMERALS TO WORD

MAGIC SQUARE

ANAGRAM WITH RECURSION

VAMPIRE NUMBER

JAVA PROGRAM TO PRINT ANAGRAMS WITHOUT USING RECURSION

input n and print all combinations from 1 to n whose sum is 0.