数据结构---链表实现栈
package cn.dragon.arithmetic.model;import java.util.LinkedList;//用链表作为底层数据结构实现-栈 public class MyLinkedStack<T> {private final LinkedList<T> list = new LinkedList<>();public void push(T e) {list.add(e);}//出栈public T pop() {return list.removeFirst();}public T peek() {return list.getLast();}public int size() {return list.size();}}