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

View File

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