我有一个任务要做,涉及在队列上创建和执行操作......在指令中,他开始说这个......
Node Class: You will extend the following class for (some of) the questions below.
public class Node<T>{
protected T data;
protected Node<T> next;
}
Implement the QUEUE (FIFO) abstract data type. For this, you will create a class called Queue that extends Node<T>. Your class should have the following methods:
public void enqueue(Node<T> item)
// Purpose: adds item to the queue
// Preconditions: item should exists (not be null)
// Postconditions: item is added to the end of the queue
// the size of the queue is increased by 1
...等等,还有几页要求等...
我想知道一些我不明白的事情......是什么public class Node<T>
意思?(斜体部分)。
此外,除了入队方法之外,还有更多方法,所以我假设正确的设计需要我在此方法之外创建队列?
提前致谢!