Example #1
0
  @Test
  public void ColoursAfterInsertion() {

    RBT<Integer, String> T = buildTree();
    RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>();
    Integer EIGHTEEN = new Integer(18);
    String sEIGHTEEN = new String("eighteen");
    T.insert(EIGHTEEN, sEIGHTEEN);

    assertTrue(utils.RBTColours(T));
  }
Example #2
0
  @Test
  public void CheckContents4() {

    RBT<Integer, String> T = buildTree();
    RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>();
    Integer EIGHTEEN = new Integer(18);
    String sEIGHTEEN = new String("eighteen");
    T.insert(EIGHTEEN, sEIGHTEEN);

    assertTrue(sEIGHTEEN.equals(T.get(EIGHTEEN)));
  }
Example #3
0
  @Test
  public void SizeAfterInsertion() {

    RBT<Integer, String> T = buildTree();
    RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>();
    Integer EIGHTEEN = new Integer(18);
    String sEIGHTEEN = new String("eighteen");
    T.insert(EIGHTEEN, sEIGHTEEN);

    assertTrue(T.size() == 4);
  }
Example #4
0
  @Test
  public void SanityCheck() {

    RBT<Integer, String> T = buildTree();
    RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>();

    assertTrue(utils.RBTShape(T));
    assertTrue(utils.RBTKeyOrder(T.root()));
    assertTrue(utils.RBTColours(T));
    assertTrue(utils.RBTSizes(T.root()));
    assertTrue(utils.RBTBlackHeights(T.root()));
  }