Neatify heap

This commit is contained in:
Lars Mueller 2021-01-19 15:29:39 +01:00
parent 2711e1333a
commit 6691a64484

@ -1,10 +1,10 @@
local metatable = {__index = getfenv(1)}
function default_less_than(a, b) return a < b end
function less_than(a, b) return a < b end
--> empty min heap
function new(less_than)
return setmetatable({less_than = less_than or default_less_than}, metatable)
return setmetatable({less_than = less_than}, metatable)
end
function push(self, value)