From aeb0d4f887a0c18c36b59acc7b5df08e62020c50 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sun, 11 Oct 2020 21:32:48 +0300 Subject: Removed old homeworks --- homework/45180/hw1.html | 75 ------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 homework/45180/hw1.html (limited to 'homework/45180/hw1.html') diff --git a/homework/45180/hw1.html b/homework/45180/hw1.html deleted file mode 100644 index 74c7f4b..0000000 --- a/homework/45180/hw1.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - -
-export default class Queue {
-    constructor() {
-        this._firstNode = null;
-        this._lastNode = null;
-    }
-
-    dequeue() {
-        if (!this._firstNode) {
-            return this._firstNode;
-        }
-
-        const payload = this._firstNode.payload;
-
-        this._firstNode = this._firstNode.next;
-
-        return payload;
-    }
-
-    enqueue(item) {
-        const newNode = {
-            payload: item,
-            next: null
-        };
-
-        if (this._firstNode === null) {
-            this._firstNode = newNode;
-            this._lastNode = newNode;
-
-        } else {
-            this._lastNode.next = newNode;
-            this._lastNode = newNode;
-        }
-    }
-
-    clear() {
-        this._firstNode = null;
-        this._lastNode = null;
-    }
-
-    top() {
-        if (!this._firstNode) {
-            return this._firstNode;
-        }
-
-        return this._firstNode.payload;
-    }
-
-    isEmpty() {
-        return !this._firstNode;
-    }
-}
\ No newline at end of file -- cgit v1.3.1-26-gb76a