Update Queues.java
This commit is contained in:
parent
c725d91ecf
commit
2b3e82fd4c
@ -1,23 +1,32 @@
|
||||
/**
|
||||
* This implements Queues by using the class Queue.
|
||||
*
|
||||
* <p>
|
||||
* A queue data structure functions the same as a real world queue.
|
||||
* The elements that are added first are the first to be removed.
|
||||
* New elements are added to the back/rear of the queue.
|
||||
*
|
||||
* @author Unknown
|
||||
*
|
||||
*/
|
||||
class Queue {
|
||||
/** Max size of the queue */
|
||||
/**
|
||||
* Max size of the queue
|
||||
*/
|
||||
private int maxSize;
|
||||
/** The array representing the queue */
|
||||
/**
|
||||
* The array representing the queue
|
||||
*/
|
||||
private int[] queueArray;
|
||||
/** Front of the queue */
|
||||
/**
|
||||
* Front of the queue
|
||||
*/
|
||||
private int front;
|
||||
/** Rear of the queue */
|
||||
/**
|
||||
* Rear of the queue
|
||||
*/
|
||||
private int rear;
|
||||
/** How many items are in the queue */
|
||||
/**
|
||||
* How many items are in the queue
|
||||
*/
|
||||
private int nItems;
|
||||
|
||||
/**
|
||||
@ -118,7 +127,6 @@ class Queue{
|
||||
* This class is the example for the Queue class
|
||||
*
|
||||
* @author Unknown
|
||||
*
|
||||
*/
|
||||
public class Queues {
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user