Skip to content

Glossary: Data Structures and Algorithms in Java

offer, poll, peek

Also written: offer, poll, peek

The queue methods: `offer` adds at the back, `poll` removes and returns the front, and `peek` looks at the front without removing. On an empty queue `poll` and `peek` return `null`.

Where the book teaches it

Related terms

queueArrayDequePriorityQueuepush, pop, peek