Can someone please help me go over these codes? There are no bugs in all except LinkedListBinary.java and I have no idea why. The lines that are causing me problems are:
/** Returns an iterator of the elements stored at the nodes */
public Iterator<E> iterator() {
Iterable<Position<E>> positions = positions();
PositionList<E> elements = new NodePositionList<E>();
for (Position<E> pos: positions)
elements.addLast(pos.element());
return elements.iterator(); // An iterator of elements
}
The error is that I can only iterate from an array or an instance of java.lang.Iterable
I attached all the files, excluding the exception classes