package innerclasspackage;
import java.util.LinkedList;
public class MyStack
{
private LinkedList myLL = new LinkedList();
MyStack()
{
}
void push(int n)
{
myLL.addFirst(n);
}
void pop()
{
myLL.removeFirst();
}
int top()
{
return (Integer)myLL.get(0);
}
boolean isEmpty()
{
return myLL.isEmpty();
}
}
Monday, August 2, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment