first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
(function() {
var Queue;
Queue = (function() {
function Queue() {
this.head = null;
this.tail = null;
}
Queue.prototype.enqueue = function(item) {
if (this.tail) {
this.tail.next = item;
} else {
this.head = item;
}
this.tail = item;
};
Queue.prototype.dequeue = function() {
var item;
item = this.head;
if (item) {
if (item === this.tail) {
this.tail = null;
}
this.head = item.next;
item.next = null;
}
return item;
};
return Queue;
})();
module.exports = Queue;
}).call(this);