mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-19 17:54:42 +08:00
init with DEFAULT_CAPACITY
This commit is contained in:
@ -9,6 +9,11 @@ package DataStructures.Queues;
|
||||
*
|
||||
*/
|
||||
class Queue {
|
||||
/**
|
||||
* Default initial capacity.
|
||||
*/
|
||||
private static final int DEFAULT_CAPACITY = 10;
|
||||
|
||||
/**
|
||||
* Max size of the queue
|
||||
*/
|
||||
@ -30,6 +35,13 @@ class Queue {
|
||||
*/
|
||||
private int nItems;
|
||||
|
||||
/**
|
||||
* init with DEFAULT_CAPACITY
|
||||
*/
|
||||
public Queue() {
|
||||
this(DEFAULT_CAPACITY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
Reference in New Issue
Block a user