Update Queues.java

This commit is contained in:
Libin Yang 2019-02-25 09:33:06 +08:00 committed by GitHub
parent c725d91ecf
commit 2b3e82fd4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
/**