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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What kind of structure is a queue?

A

F.I.F.O -first in first out

Linear and dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Runtime analysis

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Common uses

A
The event queue in programs
simulating waiting lines
buffers for I/O
Print queues
Keyboard strokes
Video Frames
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the pointers in a queue called?

A

head and tail

How well did you know this?
1
Not at all
2
3
4
5
Perfectly