diff --git a/ranked_tree.js b/ranked_tree.js index 45b4d64..e979889 100644 --- a/ranked_tree.js +++ b/ranked_tree.js @@ -1,21 +1,3 @@ -class Queue { - constructor() { - this.q = []; - } - - enqueue(x) { - this.q.push(x); - } - - dequeue() { - return this.q.shift(); - } - - isEmpty() { - return this.q.length == 0; - } -} - class RankedTree { constructor() { this.root = null; diff --git a/utils.js b/utils.js index 120f869..db2c8f9 100644 --- a/utils.js +++ b/utils.js @@ -12,3 +12,21 @@ Array.prototype.equals = function (other) { return true; }; + +class Queue { + constructor() { + this.q = []; + } + + enqueue(x) { + this.q.push(x); + } + + dequeue() { + return this.q.shift(); + } + + isEmpty() { + return this.q.length == 0; + } +}