Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robindaugherty/binary_tree-ruby
Binary tree implementation in Ruby.
https://github.com/robindaugherty/binary_tree-ruby
Last synced: 6 days ago
JSON representation
Binary tree implementation in Ruby.
- Host: GitHub
- URL: https://github.com/robindaugherty/binary_tree-ruby
- Owner: RobinDaugherty
- License: mit
- Created: 2016-03-09T00:40:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T00:40:45.000Z (almost 9 years ago)
- Last Synced: 2024-11-24T04:24:15.331Z (about 2 months ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# BinaryTree
An implmentation of [`Hash`](http://ruby-doc.org/core-2.3.0/Hash.html)- and [`Set`](http://ruby-doc.org/stdlib-2.3.0/libdoc/set/rdoc/Set.html)-compatible objects using a binary tree.
This was an exercise done to test the performance of the interpreted version as compared to the native data types.
It seems that [MRI's version of Hash](http://ruby-doc.org/core-2.3.0/Hash.html) uses a binary tree internally anyway, and because it is implemented in C, it's much faster.## Installation
This has not been published as a gem, and it's not likely to be.
Don't use it in a production application.## Usage
```ruby
a = BinaryTree::Hash.new
a[:the_answer] = 42
a[:the_answer] # => 42
```## Contributing
1. Fork it ( https://github.com/[my-github-username]/binary_tree/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request