mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-26 09:13:53 +01:00
Neatify heap
This commit is contained in:
parent
2711e1333a
commit
6691a64484
4
heap.lua
4
heap.lua
@ -1,10 +1,10 @@
|
|||||||
local metatable = {__index = getfenv(1)}
|
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
|
--> empty min heap
|
||||||
function new(less_than)
|
function new(less_than)
|
||||||
return setmetatable({less_than = less_than or default_less_than}, metatable)
|
return setmetatable({less_than = less_than}, metatable)
|
||||||
end
|
end
|
||||||
|
|
||||||
function push(self, value)
|
function push(self, value)
|
||||||
|
Loading…
Reference in New Issue
Block a user