https://github.com/kflu/btree.js
a javascript btree implementation
https://github.com/kflu/btree.js
Last synced: 6 months ago
JSON representation
a javascript btree implementation
- Host: GitHub
- URL: https://github.com/kflu/btree.js
- Owner: kflu
- Created: 2015-11-15T10:16:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-23T22:06:16.000Z (over 10 years ago)
- Last Synced: 2024-05-09T12:21:41.933Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 1.91 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# btree.js
## TODOs
- Think about data access layer abstraction
- Implement deletion
- trees can specify a key comparison for JavaScript cannot override comparison operators
## Designing Providers
provider.load(this.children[i], function(childNode) {
// use child node here...
});
Since this is a async fashioin, all things need to be asyn for good. E.g., `node.search`:
node.search(key, function(result) {
// use the result...
})
Internally `search` does:
node.prototype.search = function(key, cb) {
// ...
provider.load(this.children[i], function(childnode) {
// continue search, if found, call the callback:
cb(result);
})
};