I know that ArrayDeque is fast when adding and removing simple lists. I tested it, it was quicker to add and delete than LinkedList. Because I know that it is implemented as an Array, so why not Random Access?
I read the ArrayDeque.java file in the Java src. But I do not understand it well with my English level. I've seen a lot of articles from Google and Stack Overflow, but I did not get the answers I wanted.
In conclusion, what I'm looking for is:
Thank you very much for your reply!
As mentioned in here, ArrayDeque is resizable-array implementation of the Deque interface. Underlining data-structure is Array. However, it doesn't support random access because it exposes double-ended queue interface. If you want to access a random element of Deque, you can invoke toArray()
and then access elements by index.