How can i iterate a ArrayDeque in reverse?
You can use the method descendingIterator()
to get an iterator that iterates the ArrayDeque<T>
in reverse.
Iterator<T> it = arrayDeque.descendingIterator();
while(it.hasNext()) {
// do something with it.next()
}