0

BinarySearchTree クラスは net.datastructures 5.0 のものであることに注意してください。

   public static <K, V extends Comparable> List<Entry<K, V>> sortTree(BinarySearchTree<K, V> tree) 
    {   
        List<Entry<K, V>> entries = new ArrayList<Entry<K, V>>(tree.size()); 
        entries.addAll(tree.entries());

どうすればこの問題を解決できますか?

 Error: The method addAll(Collection<? extends Entry<K,V>>) in the type List<Entry<K,V>> is not applicable for the arguments (Iterable<Entry<K,V>>)
4

1 に答える 1

0
for(Entry<K,V> entry : tree.entries()) { entries.add(entry);}
于 2012-11-30T10:45:56.583 に答える