Data Structures: Queues Flashcards
1
Q
What are queues?
A
A linear datastructure with two ends, a front and a back. Items are always added to the back of the queue and removed from the front
2
Q
What kind of structure is a queue?
A
F.I.F.O -first in first out
Linear and dynamic
3
Q
Queue opperations
A
enqueue -adding an item to the back of a queue
dequeue - removing an item from the front of a queue
peek -looing at the item at the front of a queue
isEmpty -checking to see if a queue is empty.
4
Q
Runtime analysis
A
O(n)
5
Q
Common uses
A
The event queue in programs simulating waiting lines buffers for I/O Print queues Keyboard strokes Video Frames
6
Q
What are the pointers in a queue called?
A
head and tail