@Test public void testIsEmpty() { assertTrue("Empty tree did not return true", tree.isEmpty()); tree.add(20, "S"); avlTree.add(20, "S"); assertFalse("Tree thinks its empty after one insert", tree.isEmpty()); assertFalse("AVL Tree thinks its empty after one insert", avlTree.isEmpty()); tree.add(30, "X"); tree.remove(30); assertFalse("Tree thinks its empty after one remove", tree.isEmpty()); tree.remove(20); assertTrue("Tree thinks it still has something after removal", tree.isEmpty()); }
@Override public boolean isEmpty() { if (root==null){ return true; } return false; }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public boolean isEmpty() { if (root==null){ return true; } return false; } }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public boolean isEmpty() { if (root==null){ return true; } return false; } AVLTreeImpl(boolean rotate); }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public boolean isEmpty() { if (root==null){ return true; } return false; } AVLTreeImpl(boolean rotate); void resetOpsCount(); int getOpsCount(); @Override boolean isEmpty(); @Override int size(); @Override void add(K key, V data); @Override boolean remove(K key); @Override K min(); @Override K max(); @Override int height(); @Override K root(); @Override BSTNode<K,V> getRootNode(); @Override V find(K key); @Override List<K> preorderTraversal(); @Override List<K> postorderTraversal(); @Override List<K> inorderTraversal(); @Override List<K> levelorderTraversal(); static void main(String[] args); }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public boolean isEmpty() { if (root==null){ return true; } return false; } AVLTreeImpl(boolean rotate); void resetOpsCount(); int getOpsCount(); @Override boolean isEmpty(); @Override int size(); @Override void add(K key, V data); @Override boolean remove(K key); @Override K min(); @Override K max(); @Override int height(); @Override K root(); @Override BSTNode<K,V> getRootNode(); @Override V find(K key); @Override List<K> preorderTraversal(); @Override List<K> postorderTraversal(); @Override List<K> inorderTraversal(); @Override List<K> levelorderTraversal(); static void main(String[] args);  }