Enqueue
Add an item at the rear. It waits behind everything already there.
Queue: Enqueue, dequeue, peek
enqueue 5 and it joins at the rear. Size 1.
Cost
- Best
- O(1)
- Average
- O(1)
- Worst
- O(1)
- Space
- O(1)
Before this
Taught by the same lesson
Queue covers these too, in the same run.