Skip to content

Instantly share code, notes, and snippets.

View hazzard993's full-sized avatar

Jason McKenzie hazzard993

View GitHub Profile
@hazzard993
hazzard993 / priority_queue.d.ts
Last active December 23, 2020 05:29 — forked from LukeMS/priority_queue.lua
Priority Queue implemented in lua, based on a binary heap.
declare function create<T>(this: void): PriorityQueue<T>;
interface PriorityQueue<T> {
empty(): boolean;
size(): number;
/**
* Swim up on the tree and fix the order heap property.
*/
swim(): void;
put(v: T, priority: number): void;