MCPcopy Create free account
hub / github.com/datastructures-js/priority-queue / PriorityQueue

Interface PriorityQueue

src/priorityQueue.d.ts:3–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import { ICompare } from '@datastructures-js/heap';
2
3export 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
19export const PriorityQueue: {
20 new <T>(compare: ICompare<T>, values?: T[]): PriorityQueue<T>;

Implementers 1

PriorityQueuesrc/priorityQueue.js

Calls

no outgoing calls

Tested by

no test coverage detected