Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c601e25

Browse files
SHEEVOOTSHEEVOOT
SHEEVOOT
authored and
SHEEVOOT
committed
delete unit test for bst added
1 parent 2c354b8 commit c601e25

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/_DataStructures_/Trees/BinarySearchTree/BinarySearchTree.test.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ describe('Data Structure : Binary Search Tree', () => {
1212
bst = new BST(5);
1313
});
1414

15-
it('Should insert() element to Binary Search Tree', () => {
15+
it('Should delete() an element from Binary Search Tree', () => {
1616
bst.add(4);
1717
bst.add(9);
1818
bst.add(2);
19-
bst.insert(bst.root, 3);
20-
expect(bst.traverseInorder()).toEqual([2, 3,4,5, 9]);
21-
bst.insert(bst.root, 7);
22-
expect(bst.traverseInorder()).toEqual([2,3,4,5,7, 9]);
19+
bst.delete(bst.root, 4);
20+
expect(bst.traverseInorder()).toEqual([2, 5, 9]);
21+
bst.delete(bst.root, 2);
22+
expect(bst.traverseInorder()).toEqual([5, 9]);
2323
});
2424
});
2525
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /