
Queue and Data Structure Quiz

Quiz
•
Computers
•
University
•
Hard
HASAN YIGIT
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about a priority queue?
It follows the FIFO principle.
Elements are removed based on their position in the queue.
Elements are removed based on priority, not order.
It cannot be implemented using arrays.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a feature of a double-ended queue (Deque)?
Only one end supports insertions and deletions.
Both ends support insertions and deletions.
Only rear end supports insertions.
Only front end supports deletions.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a drawback of array-based queue representation?
A. Overflow even when space is available.
B. Additional memory is required for pointers.
C. Fixed-size implementation.
D. Both A and C.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a circular queue, when the first element is enqueued, what happens to front and rear?
Both are incremented by 1.
front is set to 0, rear remains -1.
Both are set to 0.
rear is incremented, front remains -1.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a primary advantage of using a linked list for queue implementation?
Fixed-size memory.
Reduced pointer memory.
Dynamic memory allocation.
Simplified operations.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is missing in the following function for initializing a queue?
struct Queue* createQueue(unsigned capacity) {
struct Queue* queue = (struct Queue*)malloc(sizeof(struct Queue));
queue->capacity = capacity;
queue->front = -1;
queue->rear = -1;
queue->array = ____;
return queue;
}
malloc(capacity * sizeof(int))
calloc(queue->capacity, sizeof(int))
malloc(sizeof(int))
(int*)malloc(queue->capacity * sizeof(int))
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code if maxSize = 3 and elements 1, 2, 3, 4 are enqueued?
enqueue(queue, 1);
enqueue(queue, 2);
enqueue(queue, 3);
enqueue(queue, 4);
All elements are enqueued.
Overflow error occurs.
Last element overwrites the first one.
Program crashes.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Queues

Quiz
•
University
10 questions
DAY-3 DSA BOOTCAMP

Quiz
•
University
10 questions
SSK20193 KUIZ DUA

Quiz
•
12th Grade - University
10 questions
Exploring Stacks and Queues

Quiz
•
University
15 questions
Introduction to data structures

Quiz
•
University
10 questions
DS UNIT 1

Quiz
•
University
10 questions
UTS Sistem Operasi

Quiz
•
University
15 questions
Knowledge Knockout[Quiz Round](2nd-4th years)

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University