@Test public void testRoot() { assertNull(tree.root()); tree.add(20, "dd"); assertEquals((Integer) 20, tree.root()); tree.remove(20); assertNull(tree.root()); }
@Override public K root() { if (root==null){ return null; } else{ return root.key; } }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public K root() { if (root==null){ return null; } else{ return root.key; } } }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public K root() { if (root==null){ return null; } else{ return root.key; } } AVLTreeImpl(boolean rotate); }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public K root() { if (root==null){ return null; } else{ return root.key; } } 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 K root() { if (root==null){ return null; } else{ return root.key; } } 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);  }