I'm trying to convert an AVLTree implementation into a heap style array and am having some problems with generics:
public class MyAVLTree<K extends Comparable<? super K>, E> implements
OrderedDictionary<K, E> {
class AVLNode implements Locator<K, E>{
// ...
}
// ....
public Locator<K,E> [] toBSTArray() {
AVLNode[] bArray = new AVLNode[size];
makeArray(root, 0, bArray); // recursion
return bArray;
}
}
At the line AVLNode[] bArray = new AVLNode[size];
I get the following error:
"Cannot create a generic array of MyAVLTree.AVLNode"
I don't see what I'm doing wrong. Any help?