Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flyfloor/bs-tree
very simple binary search tree in Ruby
https://github.com/flyfloor/bs-tree
Last synced: about 1 month ago
JSON representation
very simple binary search tree in Ruby
- Host: GitHub
- URL: https://github.com/flyfloor/bs-tree
- Owner: flyfloor
- License: mit
- Created: 2014-09-18T17:02:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-20T05:30:33.000Z (over 10 years ago)
- Last Synced: 2024-10-29T02:40:15.545Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 183 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# BsTree
An implementation of binary tree, just 4 fun :)
## Installation
Add this line to your application's Gemfile:
gem 'bs_tree'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bs_tree
## Usage
tree root element:
@root = BsTree::Node.new(5)
and add node:
@root.insert(10)or
[1, 7, 3, 10, 8].each{|x| @root.insert x }tree sketch
5
2 7
1 3 10
8Traval, support(dlr, lrd, ldr, level):
BsTree::Node.traval(:type, @root)
type canbe ```dlr```, ```lrd```, ```ldr```, ```level```
## Contributing
1. Fork it ( http://github.com//bs_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 new Pull Request