摘要:
队列是典型的FIFO数据结构。入队(队尾添加),出队(队首删除)。 定义队列接口 public interface Queue<T> { boolean enQueue(T t); T deQueue(); int size(); } 数组实现队列 public class MyArrayQueue 阅读全文
摘要:
抽取公共代码 public abstract class MyQueue<E> { int size; public abstract boolean enqueue(E t); public abstract E dequeue(); public boolean isEmpty() { retu 阅读全文
摘要:
抽取共有代码 /** * @author mirau on 2021/4/15. * @version 1.0 */ public abstract class MyStack<E> { int size; public int size() { return size; } public bool 阅读全文