Code example for ArrayDeque

Methods: iterator

0
            return rank(key, node.getLeft());
        } 
    } 
     
    public Iterator<K> iterator() {
        Queue<K> keys = new ArrayDeque<K>();
        inorder(keys,root);
        return keys.iterator();
    } 
 
    private void inorder(Queue<K> keys, Node<K, V> node) {
        if (node == null) { 
            return; 
        } 
        inorder(keys, node.getLeft());
        keys.add(node.getKey());
        inorder(keys, node.getRight());
    } 
     
    public K floor(K key) {
        Node<K,V> node = floor(root, key);