标签:str exception 索引 list 5.6 min net array ali


栈的一些操作
| 操作 | 描述 |
|---|---|
| enqueue | 向队列末端添加一个元素 |
| dequeue | 从队列前端删除一个元素 |
| first | 考察队列前端的那个元素 |
| isEmpty | 判定队列是否为空 |
| size | 判定队列中的元素数目 |
| toString | 返回队列中的字符串表示 |
public interface QueueADT<T> {
public void enqueue(T element);
public T dequeue();
public T first();
public boolean isEmpty();
public int size();
public String toString();
}
}

public CircularArrayQueue() {
this (DEFAULT_CAPACITY);
}
这个()里就会报错,我直接把里面改成100就好了
first()方法的时候,我是把链表实现栈的peek()方法复制过来修改的,但是测试总是有问题,而且在CircularArrayQueue类也是这么做出来的却没有问题。

// if (isEmpty())
// throw new EmptyCollectionException("queue");
注释掉了就可以了,等我再想想正常的方法再来修改。

| 代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | ||
|---|---|---|---|---|
| 目标 | 5000行 | 30篇 | 400小时 | |
| 第一周 | 0/0 | 1/1 | 8/8 | |
| 第二周 | 671/671 | 1/2 | 17/25 | |
| 第二周 | 345/1016 | 1/3 | 15/40 |
20172321 2018-2019《Java软件结构与数据结构》第三周学习总结
标签:str exception 索引 list 5.6 min net array ali
原文地址:https://www.cnblogs.com/N-idhogg/p/9708199.html