| 1 | import { ICompare } from '@datastructures-js/heap'; |
| 2 | |
| 3 | export interface PriorityQueue<T> extends Iterable<T> { |
| 4 | [Symbol.iterator](): Iterator<T, any, undefined>; |
| 5 | size(): number; |
| 6 | isEmpty(): boolean; |
| 7 | front(): T | null; |
| 8 | back(): T | null; |
| 9 | enqueue(value: T): PriorityQueue<T>; |
| 10 | push(value: T): PriorityQueue<T>; |
| 11 | dequeue(): T | null; |
| 12 | pop(): T | null; |
| 13 | remove(cb: (value: T) => boolean): T[]; |
| 14 | contains(cb: (value: T) => boolean): boolean; |
| 15 | toArray(): T[]; |
| 16 | clear(): void; |
| 17 | } |
| 18 | |
| 19 | export const PriorityQueue: { |
| 20 | new <T>(compare: ICompare<T>, values?: T[]): PriorityQueue<T>; |
no outgoing calls
no test coverage detected