MCPcopy Create free account
hub / github.com/codemix/graph / pop

Method pop

packages/graph/src/Steps.ts:4991–4999  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4989 }
4990
4991 pop(): T | undefined {
4992 if (this.heap.length === 0) return undefined;
4993 if (this.heap.length === 1) return this.heap.pop();
4994
4995 const min = this.heap[0];
4996 this.heap[0] = this.heap.pop()!;
4997 this.bubbleDown(0);
4998 return min;
4999 }
5000
5001 private bubbleUp(index: number): void {
5002 while (index > 0) {

Callers 1

dijkstraMethod · 0.95

Calls 1

bubbleDownMethod · 0.95

Tested by

no test coverage detected