Queues Flashcards

1
Q

a linear data structure that follows the First-In-First-Out (FIFO)principle.

A

Queues

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

(T or F)in queues first element added is the first one to be removed

A

True

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

(T or F)in queues It represents a collection of elements in which elements are added at one end (rear) and removed from the other end (front).

A

True

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

adds an element to the rear(end) of the queue. The newly added element becomes the last one in the queue.

A

Enqueue(insertion)

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

removes the element from the front of the queue. The next element in the queue becomes the new front.

A

Dequeue(deletion)

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

view the element at the front of the queue without removing it.

A

Peek

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

array-based
last element of the queue (where you add)

A

Rear

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

array-based
index of first element of the queue (where you delete)

A

Front

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

array-based
rear and front is -1

A

empty queue

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

array-based
rear is incremented by 1
new element is inserted at index rear
initially empty queue(front is -1) front is made 0

A

insertion

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

array-based
front is incremented by 1
element at index front is taken out

A

deletion

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

array-based
(T or F) If front is equal to rear, there is one element in the queue, except in initially empty queue
ex. front = 3, rear = 3

A

True

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

array-based
(T or F) Number of elements can be determined by
rear - front + 1, except empty queue

A

True

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

array-based
front is -1

A

queue is empty

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

array-based
front is equal to rear + 1

A

queue is empty

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

array-based
rear becomes equal to arraySize - 1

A

queue is full