How sanishpoudel/binary-search-trees works
This repository is a small JavaScript binary-search-tree implementation. Its core workflow builds a tree from values, supports ordered lookup and mutation, and exposes traversals and structural queries; rebalancing rebuilds from a traversal. The only source file also contains a pretty-printer and a small top-level demonstration. No separate application, persistence layer, or external integration is documented.
Main entry points: bst.js Rebalance tree
Components 12
Tree operations
- Binary search tree
bst.js - Tree node
bst.js - Build tree
bst.js - Search values
bst.js - Insert and delete
bst.js - Balance checks
bst.js - Rebalance tree
bst.js
Traversal and display
- Tree traversals
bst.js - Height and depth
bst.js - Pretty printer
bst.js
Other components
- Library user
- Traversal callback
Connections 13
- Library user → Build tree: provides values
bst.js - Build tree → Tree node: creates nodes
bst.js - Library user → Search values: queries values
bst.js - Library user → Insert and delete: changes values
bst.js - Library user → Balance checks: checks balance
bst.js - Library user → Rebalance tree: requests rebuild
bst.js - Rebalance tree → Tree traversals: collects values
bst.js - Rebalance tree → Build tree: rebuilds tree
bst.js - Library user → Tree traversals: requests traversal
bst.js - Tree traversals → Traversal callback: invokes callback
bst.js - Library user → Height and depth: requests metrics
bst.js - Library user → Pretty printer: prints tree
bst.js - Pretty printer → Tree node: reads children
bst.js