
Quiz on Queue Concepts 1

Quiz
•
Computers
•
University
•
Medium
HASAN YIGIT
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly describes the operation of a queue?
Last-In-First-Out (LIFO)
First-In-First-Out (FIFO)
Last-In-Last-Out (LILO)
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What condition indicates a queue is empty in an array implementation?
rear == capacity - 1
front == rear
front == -1 && rear == -1
front > rear
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the initialization of a queue, what are the initial values of front and rear?
0, 0
-1, -1
0, -1
None of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is an overflow condition determined in a circular queue?
rear == front
(front == rear + 1) || (front == 0 && rear == maxSize - 1)
front == -1
rear == maxSize
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
During the enqueue operation of a simple array-based queue, what happens when the queue is full?
The rear pointer is reset to -1.
Elements are shifted left.
The enqueue operation is blocked.
The rear pointer cycles to 0.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed by this code after enqueue operations? enqueue(queue, 5); enqueue(queue, 10); printf("Front: %d", queue->array[queue->front]);
Front: 5
Front: 10
Undefined behavior
No output (program crashes).
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What condition should replace ___ in the following dequeue function? int dequeue(struct Queue* queue) { if (___) { printf("Queue is empty\n"); return -1; } int item = queue->array[queue->front]; if (queue->front == queue->rear) { queue->front = queue->rear = -1; } else { queue->front = (queue->front + 1) % queue->capacity; } return item; }
queue->rear == queue->capacity
queue->front == queue->rear
queue->front == -1 && queue->rear == -1
queue->front == -1
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
Queue

Quiz
•
University
10 questions
Understanding Stacks and Queues

Quiz
•
University
15 questions
DSA AI- B

Quiz
•
University
15 questions
Queues

Quiz
•
11th Grade - Professi...
15 questions
Queue - Data Structures

Quiz
•
University
5 questions
DSA Quiz 24.7.2024

Quiz
•
University
9 questions
Quiz on Data Structures

Quiz
•
University
5 questions
DSA day 4

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University