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 TestRank_withValue_lowerThanLowest_returnZero {
- @Test
- public void testRank_withValue_lowerThanLowest_returnZero() {
- BinarySearchTree<Integer> bst = new BinarySearchTree<>();
- bst.insert(12);
- bst.insert(21);
- bst.insert(5);
- bst.insert(8);
- bst.insert(1);
- bst.insert(18);
- bst.insert(23);
- Assert.assertEquals(7, bst.count());
- int rank = bst.rank(-1);
- Assert.assertEquals(0, rank);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement