@Test public void testLevelorderTraversal() { List<Integer> list = tree.levelorderTraversal(); assertTrue(list.isEmpty()); tree.add(13, "sdf"); tree.add(9, "wer"); tree.add(16,"sdxv"); tree.add(5, "wer"); tree.add(10, "sdf"); tree.add(1, "werf"); tree.add(6, "pk"); tree.add(14, "nn"); tree.add(26, "dd"); list = tree.levelorderTraversal(); System.out.println("Level: " + list.toString()); assertEquals("Wrong number of elements", 9 , list.size()); assertEquals("First element wrong", (Integer) 13, list.get(0) ); assertEquals((Integer) 9,list.get(1)); assertEquals((Integer) 16, list.get(2)); assertEquals((Integer) 6, list.get(8)); }
@Override public List<K> levelorderTraversal() { List<K> keyList = new ArrayList<K>(); return levelorderTraversal(root,keyList); }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public List<K> levelorderTraversal() { List<K> keyList = new ArrayList<K>(); return levelorderTraversal(root,keyList); } }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public List<K> levelorderTraversal() { List<K> keyList = new ArrayList<K>(); return levelorderTraversal(root,keyList); } AVLTreeImpl(boolean rotate); }
AVLTreeImpl implements IAVLBinaryTree<K, V> { @Override public List<K> levelorderTraversal() { List<K> keyList = new ArrayList<K>(); return levelorderTraversal(root,keyList); } 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 List<K> levelorderTraversal() { List<K> keyList = new ArrayList<K>(); return levelorderTraversal(root,keyList); } 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);  }