A collection of useful data structures and other utils I've built while building different projects on the Ethereum blockchain.
- Completion of other common heap functions (heapify, extract, etc)
- Median Heap (great solution for the moving median problem)
- QuickSelect implementation (with Lomuto partitions)
- Gas cost analysis
- Node package available via npm
All feedback and pull requests are welcome! If you see a way to optimize, please raise a PR! I will be happy to review and discuss any changes with you! I am adding items to this repo as I build them for other projects, so I am not focusing primarily on this and would greatly appreciate any help.
This project was created using Truffle CLI. Useful Commands:
- truffle develop (spin up your own development blockchain)
- truffle compile (compile all contracts)
- truffle migrate (migrate all compiled contracts to development blockchain)
- truffle test (run all unit tests)
I do not guarantee these are completely optimized. Use of these implementations may or may not result in optimal gas costs for transactions. By the very nature of the current version of the Ethereum blockchain, operations with large amounts of data tend to be expensive. In the near future, I will be publishing some analysis of gas usage as well as making some optimizations.
Every thing I publish to this repository is available under the MIT license.