Array-backed implementation of a deque. Supports O(1) random access, and amortized O(1) insertion and removal at the front and back of the deque
npm install array-dequeKind: global class
* ArrayDeque
* new ArrayDeque(initSize, x)
* .push_front(x)
.set(i, x) ⇒ \
* .push_back(x)
.pop_front() ⇒ \
.pop_back() ⇒ \
* .toArray() ⇒ Array.<any>
| Param |
| --- |
| initSize |
| x |
Kind: instance method of ArrayDeque
| Param |
| --- |
| x |
Kind: instance method of ArrayDeque
Returns: \* - Previous element at i
| Param | Description |
| --- | --- |
| i | Index of the element to set |
| x | The value that should be set |
Kind: instance method of ArrayDeque
| Param |
| --- |
| x |
Kind: instance method of ArrayDeque
Returns: \* - First element in the deque
Kind: instance method of ArrayDeque
Returns: \* - Last element in the deque
Kind: instance method of ArrayDeque