https://github.com/blaknite/lua-binary-heap
Binary heap data structure implemented in lua.
https://github.com/blaknite/lua-binary-heap
binary-heap lua
Last synced: 3 months ago
JSON representation
Binary heap data structure implemented in lua.
- Host: GitHub
- URL: https://github.com/blaknite/lua-binary-heap
- Owner: blaknite
- License: mit
- Created: 2016-04-18T04:19:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-20T04:51:58.000Z (about 9 years ago)
- Last Synced: 2025-02-03T23:55:58.087Z (5 months ago)
- Topics: binary-heap, lua
- Language: Lua
- Homepage: https://github.com/blaknite/lua-binary-heap
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-binary-heap
Binary heap data structure implemented in lua.Built as a class with [kikito's middleclass](https://github.com/kikito/middleclass) which you will need as a dependency.
## Usage
```lua
heap = Heap:new() -- creates a min heap
=> Heapheap:insert(3, 'first payload')
=> nil
heap:insert(1, 'second payload')
=> nilweight, payload = heap:pop()
=> 1, 'second payload'
```For all methods and their usage see comments within `heap.lua`.