Queues Flashcards

1
Q

Define Queue

A
  • abstract data type that holds an ordered, linear sequence of items.
  • pointer for front and rear
  • FIFO
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define Priority Queue

A
  • each element has a priority

- inserted ahead of those with lower priority and behind those of an equal priority.

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

Operations of priority queue

A
  • enqueue()
  • dequeue()
  • is_empty()
  • is_full()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Define Circular queue

A
  • reuses empty slots at the front of the array
  • wraps around as items are enqueued or dequeue
  • front and rear pointers
  • if front = rear, queue is empty
  • if rear -1 from front, queue is full
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Applications of queues

A
  • print tasks (print queue)

- tasks in order of priority

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