import java.io.*; import java.util.*; import java.lang.Integer; import java.lang.*; class StackX { private final int SIZE = 20; private char[] st; private int top; public StackX() // constructor { st = new char[SIZE]; // make array top = -1; } public void push(char j) // put item on stack { st[++top] = j; } public char pop() // take item off stack { return st[top--]; } public char peek() // peek at top of stack { return st[top]; } public boolean isEmpty() // true if nothing on stack { return (top == -1); } public boolean CheckExp(String value) { int in = 4; StackX stack = new StackX(); char[] OpArray = new char[in]; OpArray[0] = '+'; OpArray[1] = '-'; OpArray[2] = '*'; OpArray[3] = '/'; //char OpenParenthese = '('; //char CloseParanthese = ')'; if (value.charAt(0)=='+' || value.charAt(0)=='-' || value.charAt(0)=='*' || value.charAt(0)=='/'){ return false; } if (value.charAt(value.length()-1)=='+' || value.charAt(value.length()-1)=='-' || value.charAt(value.length()-1)=='*' || value.charAt(value.length()-1)=='/'){ return false; }//end if for (int i = 0;iCharArray.length/2;h++){ CharArray2[h]=CharArray[h]; } }//end if else{ newNode.Data = CharArray[CharArray.length/2+1]; root = newNode; }//end else }//end if else{ Node current = root; Node parent = current; while (current !=null){ if(getNumberOfChildren(parent)==0){ parent.rightChild = }//end if }//end while }//end else }//end for } //------------------------------------------------------------- public void Divid(String value) { char[] OpArray = new char[4]; char[] CharArray = new char[value.length()]; int j = 0; boolean IsMidOperator = false; int upper1 , upper2; int lower2, lower1; int mid1, mid2; OpArray[0] = '+'; OpArray[1] = '-'; OpArray[2] = '*'; OpArray[3] = '/'; for (int i=0; i