During my C school days, when I implemented Queue, I implemented them on top LinkedList. So basically I had two pointers (front and back) for operations Queueon top LinkedListor better than one pointer on top of above CircularLinkedList.
I am learning Java Collections Framework, and I notice that the design completely decoupled the interfaces Listand Queue, and the implementation branches out as follows -

I think it AbstractQueueshould be subclassed somewhere inside AbstractList. Maybe not inside ArrayList, because I don't want random access to elements, but maybe inside AbstractSequentialList, hmm? (I understand, I could be completely wrong here)
source
share