Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.Assert;
- import org.junit.Test;
- import java.util.ArrayList;
- import java.util.List;
- public class TestDelete_deleteRoot_setInorderSuccessor {
- @Test
- public void testDelete_deleteRoot_setInorderSuccessor() {
- BinarySearchTree<Integer> bst = new BinarySearchTree<>();
- bst.insert(12);
- bst.insert(21);
- bst.insert(5);
- bst.insert(1);
- bst.insert(8);
- bst.insert(18);
- bst.insert(17);
- bst.insert(16);
- bst.insert(23);
- BinarySearchTree.Node<Integer> root = bst.getRoot();
- Assert.assertEquals(Integer.valueOf(12), root.getValue());
- Assert.assertEquals(9, bst.count());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement