Advertisement
IvetValcheva

Test 3

Dec 7th, 2022
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 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 TestDeleteMax2_shouldWorkCorrectly {
  8.  
  9.     @Test
  10.     public void testDeleteMax2_shouldWorkCorrectly() {
  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.  
  20.         bst.deleteMax();
  21.  
  22.         BinarySearchTree.Node<Integer> right_node = bst.getRoot().getRight();
  23.         Assert.assertEquals(Integer.valueOf(18), right_node.getValue());
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement