April 2018
Beginner to intermediate
426 pages
10h 19m
English
As usual, we will start by declaring the Deque class and its constructor:
class Deque { constructor() { this.count = 0; this.lowestCount = 0; this.items = {}; }}
Since a deque is a special queue, we will notice that it shares some code snippets with the constructor, the same internal properties, and the following methods: isEmpty, clear, size, and toString.
Since the deque allows inserting and removing from both ends, we will also have the following methods: