During my C learning days, when I had implemented a Queue
, I implemented them on top of a LinkedList
. So essentially I had two pointers (front and rear) for the Queue
operations on top of LinkedList
, or better one front pointer on top of a CircularLinkedList
.
I am learning the Java Collections Framework
, and I observe that the design has completely disjointed the List
and Queue
interfaces, and the implementations branches out in following fashion -
I think AbstractQueue
should have been subclassed somewhere inside AbstractList
. Maybe not inside ArrayList
, because I do not want random access to elements, but maybe inside AbstractSequentialList
, hmm? (I realize, I could be completely wrong here)