Advertisement
IvetValcheva

Test 12

Dec 8th, 2022
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import org.junit.Assert;
  2. import org.junit.Test;
  3.  
  4. import java.util.ArrayList;
  5. import java.util.List;
  6.  
  7. public class TestDelete_deleteRoot_setInorderSuccessor {
  8.  
  9.     @Test
  10.     public void testDelete_deleteRoot_setInorderSuccessor() {
  11.         BinarySearchTree<Integer> bst = new BinarySearchTree<>();
  12.  
  13.         bst.insert(12);
  14.         bst.insert(21);
  15.         bst.insert(5);
  16.         bst.insert(1);
  17.         bst.insert(8);
  18.         bst.insert(18);
  19.         bst.insert(17);
  20.         bst.insert(16);
  21.         bst.insert(23);
  22.  
  23.         BinarySearchTree.Node<Integer> root = bst.getRoot();
  24.         Assert.assertEquals(Integer.valueOf(12), root.getValue());
  25.         Assert.assertEquals(9, bst.count());
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement