I have an assignment to do that involves creating and performing operations on a queue... In the instruction he starts off by saying this...
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
... and so on with a few more pages of requirements etc...
I would like to know a few things that I do not understand...
what does public class Node<T>
mean? (italic part).
Also, there are many more methods other than the enqueue one, so I'm assuming proper design would require me creating the queue outside this method?
Thanks in advance!