MCQ Collection
Data Structures MCQs
Practice Data Structures questions with answers and explanations.
Choose an option to check your answer.
A.
Breadth-First Search
B.
Bloom Filter
C.
Bucket Sort
D.
Suffix Array
Show Answer
Correct Answer: A. Breadth-First Search
Explanation:
Breadth-First Search is a graph traversal that explores vertices level by level.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
simple hash-table implementations
B.
shortest paths in unweighted graphs
C.
workloads with strong locality of reference
D.
fast random access when the index is known
Show Answer
Correct Answer: B. shortest paths in unweighted graphs
Explanation:
Breadth-First Search is commonly used for shortest paths in unweighted graphs.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
every level is completely filled
B.
it may examine every element
C.
it typically uses a queue
D.
collisions must be handled when keys map to the same position
Show Answer
Correct Answer: C. it typically uses a queue
Explanation:
The defining property is that it typically uses a queue.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
Radix Tree
B.
Amortized Analysis
C.
Quick Sort
D.
Breadth-First Search
Show Answer
Correct Answer: D. Breadth-First Search
Explanation:
Breadth-First Search fits because it supports shortest paths in unweighted graphs and it typically uses a queue.
Both clues point to this choice.
Choose an option to check your answer.
A.
Depth-First Search
B.
Queue
C.
Memory Pool
D.
Linear Probing
Show Answer
Correct Answer: A. Depth-First Search
Explanation:
Depth-First Search is a traversal that explores as deeply as possible before backtracking.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
ordered searching and dynamic set operations
B.
cycle detection, topological reasoning, and connectivity
C.
stable sorting with guaranteed O(n log n) time
D.
implementing ordered maps and sets
Show Answer
Correct Answer: B. cycle detection, topological reasoning, and connectivity
Explanation:
Depth-First Search is commonly used for cycle detection, topological reasoning, and connectivity.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
poor pivot choices can produce quadratic time
B.
constant factors and lower-order terms are ignored asymptotically
C.
it typically uses recursion or a stack
D.
it reuses blocks instead of requesting each one separately from the system
Show Answer
Correct Answer: C. it typically uses recursion or a stack
Explanation:
The defining property is that it typically uses recursion or a stack.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
Breadth-First Search
B.
Selection Sort
C.
Stable Sorting
D.
Depth-First Search
Show Answer
Correct Answer: D. Depth-First Search
Explanation:
Depth-First Search fits because it supports cycle detection, topological reasoning, and connectivity and it typically uses recursion or a stack.
Both clues point to this choice.
Choose an option to check your answer.
A.
Binary Search
B.
Reference Counting
C.
Min-Heap
D.
Adjacency List
Show Answer
Correct Answer: D. Adjacency List
Explanation:
Adjacency List fits because it supports sparse graphs and its space usage is proportional to vertices plus edges.
Both clues point to this choice.
Choose an option to check your answer.
A.
Adjacency List
B.
Hash Table
C.
Max-Heap
D.
Splay Tree
Show Answer
Correct Answer: A. Adjacency List
Explanation:
Adjacency List is a graph representation storing the neighbors of each vertex.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
efficient insertion or deletion when a node reference is available
B.
sparse graphs
C.
function-call management and undo operations
D.
simple hash-table implementations
Show Answer
Correct Answer: B. sparse graphs
Explanation:
Adjacency List is commonly used for sparse graphs.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
it is generally not stable
B.
the highest- or lowest-priority item is served first
C.
its space usage is proportional to vertices plus edges
D.
its merge step usually needs auxiliary storage for arrays
Show Answer
Correct Answer: C. its space usage is proportional to vertices plus edges
Explanation:
The defining property is that its space usage is proportional to vertices plus edges.
The other statements describe different structures or concepts.