This project contains a skeleton for you to implement a binary search tree. This is a test-driven project. Run the tests and read the top-most error. If it's not clear what is failing, open the test/test.js file to figure out what the test is expecting. Make the top-most test pass.
Keep making the top-most test pass until all tests pass.
- Clone the project from https://github.com/appacademy-starters/data-structures-binary-search-tree-starter.
cd
into the project foldernpm install
to install dependencies in the project root directorynpm test
to run the specs- You can view the test cases in
test/test.js
. Your job is to write code in- lib/bst.js to implement the
BST
class - BONUS: problems/04-leet-code-110.js as a scratch pad to work on the LeetCode.com problem at https://leetcode.com/problems/balanced-binary-tree/
- BONUS: problems/05-leet-code-108.js as a scratch pad to work on the LeetCode.com problem at https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
- BONUS: problems/06-leet-code-450.js as a scratch pad to work on the LeetCode.com problem at https://leetcode.com/problems/delete-node-in-a-bst/# binary-search-tree-project2
- lib/bst.js to implement the