MCQ Collection
Data Structures 300 Unique MCQs
Practice Data Structures 300 Unique questions with answers and explanations.
Choose an option to check your answer.
A.
Heap Sort
B.
Queue
C.
Recursion Stack
D.
Weighted Graph
Show Answer
Correct Answer: A. Heap Sort
Explanation:
Heap Sort is a comparison sort that repeatedly removes an extreme element from a heap.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
search-intensive applications requiring predictable logarithmic height
B.
in-place sorting with O(n log n) worst-case time
C.
sorting fixed-length integers or strings
D.
analyzing balanced full trees
Show Answer
Correct Answer: B. in-place sorting with O(n log n) worst-case time
Explanation:
Heap Sort is commonly used for in-place sorting with O(n log n) worst-case time.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
resizing may require allocating a larger block and copying elements
B.
cycles can prevent unreachable objects from being reclaimed
C.
it is generally not stable
D.
each edge connects two vertices bidirectionally
Show Answer
Correct Answer: C. it is generally not stable
Explanation:
The defining property is that it is generally not stable.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
Quick Sort
B.
Counting Sort
C.
Bubble Sort
D.
Heap Sort
Show Answer
Correct Answer: D. Heap Sort
Explanation:
Heap Sort fits because it supports in-place sorting with O(n log n) worst-case time and it is generally not stable.
Both clues point to this choice.
Choose an option to check your answer.
A.
Counting Sort
B.
Disjoint Set Union
C.
Heap
D.
Queue
Show Answer
Correct Answer: A. Counting Sort
Explanation:
Counting Sort is a non-comparison sort that counts occurrences of bounded integer keys.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
reducing primary clustering compared with linear probing
B.
sorting integers from a small known range
C.
in-place sorting with O(n log n) worst-case time
D.
keeping tree operations efficient
Show Answer
Correct Answer: B. sorting integers from a small known range
Explanation:
Counting Sort is commonly used for sorting integers from a small known range.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
both front and rear operations can be efficient
B.
it is commonly implemented using a hash map plus a doubly linked list
C.
its running time depends on both item count and key range
D.
each digit pass must use a stable subroutine in common LSD implementations
Show Answer
Correct Answer: C. its running time depends on both item count and key range
Explanation:
The defining property is that its running time depends on both item count and key range.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
Priority Queue
B.
Reference Counting
C.
Queue
D.
Counting Sort
Show Answer
Correct Answer: D. Counting Sort
Explanation:
Counting Sort fits because it supports sorting integers from a small known range and its running time depends on both item count and key range.
Both clues point to this choice.
Choose an option to check your answer.
A.
Quick Sort
B.
Complete Binary Tree
C.
Min-Heap
D.
Weighted Graph
Show Answer
Correct Answer: A. Quick Sort
Explanation:
Quick Sort is a divide-and-conquer sort that partitions around a pivot.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
hash tables with flexible load factors
B.
fast general-purpose in-memory sorting
C.
range queries with point or range updates
D.
memory-efficient prefix indexing
Show Answer
Correct Answer: B. fast general-purpose in-memory sorting
Explanation:
Quick Sort is commonly used for fast general-purpose in-memory sorting.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
its space usage is quadratic in the number of vertices
B.
resizing may require allocating a larger block and copying elements
C.
poor pivot choices can produce quadratic time
D.
the function is bounded above and below by constant multiples
Show Answer
Correct Answer: C. poor pivot choices can produce quadratic time
Explanation:
The defining property is that poor pivot choices can produce quadratic time.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
AVL Tree
B.
Directed Graph
C.
Stack
D.
Quick Sort
Show Answer
Correct Answer: D. Quick Sort
Explanation:
Quick Sort fits because it supports fast general-purpose in-memory sorting and poor pivot choices can produce quadratic time.
Both clues point to this choice.