Exemplo n.º 1
0
 @Test
 public void poistoPienentääKokoa() {
   int size = bintree.getSize();
   bintree.delete(15);
   int size2 = bintree.getSize();
   assertEquals(size2, size - 1);
 }
Exemplo n.º 2
0
 @Test
 public void juurenPoistoOnnistuu() {
   int size = bintree.getSize();
   bintree.delete(14);
   int size2 = bintree.getSize();
   System.out.println("--------------\nJuuren poisto: ");
   bintree.print(bintree.getRoot());
   System.out.println("--------------");
   assertEquals(size2, size - 1);
 }
Exemplo n.º 3
0
 @Test
 public void yksiLapsisenPoistoOnnistuu() {
   int size = bintree.getSize();
   bintree.delete(2);
   int size2 = bintree.getSize();
   System.out.println("--------------\nYksilapsisen poisto: ");
   bintree.print(bintree.getRoot());
   System.out.println("--------------");
   assertEquals(size2, size - 1);
 }