1.4.2 Data structures - Queues Flashcards
(11 cards)
1
Q
Define a queue
A
- FIFO data structure
- items added to end of queue
- items removed from front of queue
2
Q
Define an abstract data type
A
A logical description of how we view the data and possible operations
3
Q
Four operations of queues
A
- add item to rear of queue
- remove item from front of queue
- check if queue is empty
- check if queue is full
4
Q
Pointers in queues
A
- back/tail pointer always points to last item
- front/head pointer always points to first item
5
Q
Define a queue overflow
A
An attempt to enqueue an item in a full queue
6
Q
Define a queue underflow
A
Trying to dequeue an item from an empty queue
7
Q
Function of enQueue(item)
A
Adds an item to the rear
8
Q
Function of deQueue
A
Remove and return an item from the front
9
Q
Function of isEmpty
A
- indicates if the queue is empty
- returns true or false
10
Q
Function of isFull
A
- indicates if the queue is full
- returns true or false
11
Q
Define a circular queue
A
Cycles the back pointer to the front of the array when it reaches the end