下面的代码是什么意思i
publicclassMyStack<E>{privateLinkedList<E>ll=newLinkedList<E>();publicvoidpush(Eo){ll...
public class MyStack<E>
{
private LinkedList<E> ll = new LinkedList<E>();
public void push(E o)
{
ll.addLast(o);
}
public E pop()
{
return ll.removeLast();
}
public E peek()
{
return ll.getLast();
}
public boolean empty()
{
return ll.isEmpty();
}
} 展开
{
private LinkedList<E> ll = new LinkedList<E>();
public void push(E o)
{
ll.addLast(o);
}
public E pop()
{
return ll.removeLast();
}
public E peek()
{
return ll.getLast();
}
public boolean empty()
{
return ll.isEmpty();
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询