Professional Documents
Culture Documents
*;
class StackApplication {
/**
* @param args
*/
public static void main(String[] args) {
getset.setCapacity(100);
int inputs = Integer.parseInt(scan.nextLine());
class infixpost{
static int Prec(char ch)
{
if(ch=='+'||ch=='-')
return 1;
else if(ch=='*'||ch=='/')
return 2;
else if(ch=='^')
return 3;
return -1;
}
public String infixtopostfix(String input) {
String result="";
while (!S.isEmpty())
result += S.pop();
return result;
}
}
interface stack<E> {
int size();
boolean isEmpty();
void push(E e);
E pop();
E top();
void printStack();
}
class CapacityGetterSetter {
private static int stackcap;
public StackArray() {
CAPACITY = getset.getCapacity();
data = (E[]) new Object[CAPACITY];
}
public E top() {
// TODO Auto-generated method stub
if (isEmpty()){
System.out.println("StackEmptyException");
return null;
}
else {
return data[t];
}
}
public E pop() {
// TODO Auto-generated method stub
if (isEmpty()) {
System.out.println("StackEmptyException");
return null;
} else {
E temp = data[t];
data[t] = null;
t = t - 1;
return temp;
}