1.4.2 Data structures - Queues Flashcards

(11 cards)

1
Q

Define a queue

A
  1. FIFO data structure
  2. items added to end of queue
  3. items removed from front of queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define an abstract data type

A

A logical description of how we view the data and possible operations

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

Four operations of queues

A
  1. add item to rear of queue
  2. remove item from front of queue
  3. check if queue is empty
  4. check if queue is full
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Pointers in queues

A
  1. back/tail pointer always points to last item
  2. front/head pointer always points to first item
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define a queue overflow

A

An attempt to enqueue an item in a full queue

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

Define a queue underflow

A

Trying to dequeue an item from an empty queue

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

Function of enQueue(item)

A

Adds an item to the rear

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

Function of deQueue

A

Remove and return an item from the front

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

Function of isEmpty

A
  1. indicates if the queue is empty
  2. returns true or false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Function of isFull

A
  1. indicates if the queue is full
  2. returns true or false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define a circular queue

A

Cycles the back pointer to the front of the array when it reaches the end

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