Queues Flashcards

1
Q

order acronym ?

A

FIFO - first in first out

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

4 key operators

A

Enqueue - remove item from the rear
Dequeue - remove item from the front
IsEmpty - check if the queue is empty
IsFull - check if the queue is full

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

the three queue implementations?

A

Linear Queue
Circular Queue
Priority Queue

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

Linear Queue

A

implemented with a fixed size array
dequeuing/enqueueing - very process intensive
front and rear pointers used to indicate which range of index values are being used.
empty queue detected when rearPointer = frontPointer = -1
full queue when rearPointer = maxSize - 1

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

Circular Queue

A

reuses free spaces at the front of the queues that have been “freed”
pointers increment by 1 in a loop - equation for it –> front = (front + 1) MOD (maxSize)
rear = (rear + 1) MOD (maxSize)

full queue when size = maxSize
empty queue when size = 0

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

Priority Queue

A

some items are allowed to ‘jump’ the queue
type of queue used when items arriving have some type of priority associated with them

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