removed PriorityQueue in favor of FlatQueue

This commit is contained in:
RyanGuild 2024-10-23 15:04:24 -04:00
parent 8a80faffa5
commit 7c29e6dfa3
6 changed files with 33 additions and 60 deletions

View file

@ -1,29 +0,0 @@
/**
* @template T
*/
export class PriorityQueue extends Array {
/**
* @param {{comparator: (a:T, B:T) => number | boolean}} options
*/
constructor({comparator}) {
super();
}
/**
* @param {T} value
*/
enqueue(value) {
this.push(value);
this.sort(comparator);
}
/**
* @returns {T}
*/
dequeue() {
return this.shift();
}
}
export default PriorityQueue;
globalThis.PriorityQueue = PriorityQueue;