This commit is contained in:
mindfulminun committed 2024-07-20 15:30:48 -05:00
1 parent 9cf0bf415b
commit 71323fc7fd
25 files changed
+186 -94

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ export class BinaryHeap<T> implements Iterable<T> {
for (const el of initials) this.push(el)
}
*[Symbol.iterator]() {
*[Symbol.iterator](): Generator<NonNullable<T>, void, unknown> {
while (this.length !== 0) yield this.pop()!
}
@@ -112,5 +112,5 @@ export class BinaryHeap<T> implements Iterable<T> {
}
/** The number of elements in the heap */
get length() { return this.#elements.length }
get length(): number { return this.#elements.length }
}