I was browsing through the Java docs to look for the Java equivalent for C++’s STL Queue, but all I found was an interface called Queue and a bunch of implementations I can’t make heads or tails of.
Does Java have an implementation for Queue that’s just a FIFO data structure without the added bells and whistles? I only need the enqueue, dequeue and front operations and the data structure should allow duplicates.
Queuewill work. Use any implementation you like.LinkedListorConcurrentLinkedQueuefor example.enqueue=offer(..)dequeue=poll()front=peek()