Lesson 3 Flashcards

(16 cards)

1
Q

a fundamental data structure in computer science, used to store and manage a collection of elements in a specific order.

A

Queue

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

It follows the First In, First Out (FIFO) principle, meaning the first element added to it will be the first one removed.

A

Queue

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

This is similar to a real-world example, like a line of people waiting at a checkout counter.

A

Queue

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

What are the common use cases of queue

A

Task Scheduling
Breadth-First Search (BFS)
Printer Queue
Customer Service

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

adds element to the rear/end

A

enqueue()/ push(x)

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

removes element from the front

A

dequeue() / pop()

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

Two ends (Front for removal, Rear/Back for insertion)

A

Access point

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

Processes in an operating system are managed in queues.

A

Task Scheduling

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

A queue is used in graph traversal algorithms.

A

Breadth-First Search (BFS)

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

Jobs sent to a printer are managed using a queue.

A

Printer Queue

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

Handling customer service requests in the order they were received.

A

Customer Service

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

What are the operation in queue

A

enqueue(x)
dequeue()
front()
size()

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

Adds element x to the rear (end) of the queue.

A

enqueue(x)

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

Removes and returns the element at the front of the queue

A

dequeue()

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

Returns the front element without removing it

A

front() / peek ()

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

Returns the number of elements currently in the queue