Binary tree
What?
Simple implementation of binary tree Class.
Why?
I wanted to create a clean implementation of Binary Tree using Javascript.
What it can do?
This implementation supports:
add
- adding items
remove
- deleting items
find
- searching
contains
- checking if element exists
traverse
- going through the tree with callback
size
- checking count of nodes
toArray
- converting to array
toString
- converting to string
Starting
npm i
Memory usage
For data sets like numbers, strings, objects, binary tree size in memory grows 20-50%.
The usage was significantly optimized in v0.2.0 (125-200%).
Unit tests
Run npm test
for single test, or npm run test-w
with watch.
License
MIT