diff --git a/implementation/03-queue.js b/implementation/03-queue.js index 18fbe68..00f4f66 100644 --- a/implementation/03-queue.js +++ b/implementation/03-queue.js @@ -5,6 +5,7 @@ class Queue { constructor() { this.head = null; this.tail = null; + this.length = 0; } enqueue(val) { @@ -15,7 +16,7 @@ class Queue { dequeue() { // Remove node from front of queue (linked list) - + // Write your hypothesis on the time complexity of this method here } diff --git a/implementation/test/03-queue-specs.js b/implementation/test/03-queue-specs.js index 7873d84..83fc80f 100644 --- a/implementation/test/03-queue-specs.js +++ b/implementation/test/03-queue-specs.js @@ -37,6 +37,7 @@ describe('Queue', () => { it('Should have head, tail and length properties', () => { expect(queue).to.have.property('head'); expect(queue).to.have.property('tail'); + expect(queue).to.have.property('length'); }); it('Should not implement an Array to store values', () => {