trekhleb / trekhleb/javascript-algorithms
BinarySearchTreeNode removing
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 197k
- Forks
- 31k
- PR merge metrics
- No merged PRs in 30d
Description
Have found an issue in the remove method
Run this test to reproduce
it.only('should remove nodes', () => {
const root = new BinarySearchTreeNode(8);
root.insert(3);
root.insert(6);
root.remove(3);
root.remove(6);
expect(root.right).toBeNull();
expect(root.left).toBeNull();
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for the BinarySearchTreeNode class and its remove method, then run the supplied “should remove nodes” test to reproduce the issue. Trace the removals of 3 and 6 from a root of 8, and consider the work done when the test passes with both root.left and root.right null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100