Queues Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are queues?

A

Abstract data types that hold ordered linear sequences of items

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

What kind of structure do they have?

A

FIFO (first in, first out)

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

How do queues keep order?

A

A pointer at the front of the queue which indicates element one and an end pointer.

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

What happens to queue when an element is removed?

A

Nothing, he remaining elements do not move up to the front of the queue

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

Define a priority queue?

A

A queue where each element has a priority so new elements can be added in front of lower priority ones.

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

What does enqueue(data) do?

A

Adds an element to a queue

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

What does dequeue() do?

A

Returns an element from the front of the queue

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

What does is_empty() do?

A

Check whether the queue is empty

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

What does is_full() do?

A

Check whether the queue is at maximum capacity

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

What kind of implementation can occur?

A

Static or dynamic

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

What are the main operations of a queue?

A

Adding and removing items

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

What characteristic does a static array have?

A

A fixed capacity

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

How does a circular queue work?

A

Reuses empty slots at the front of the array. When the rear index pointer reaches the last position, it wraps around to point at the start.

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