MCQ Collection
Data Structures MCQs
Practice Data Structures questions with answers and explanations.
Choose an option to check your answer.
A.
Fenwick Tree
B.
Deque
C.
Stable Sorting
D.
Suffix Array
Show Answer
Correct Answer: D. Suffix Array
Explanation:
Suffix Array fits because it supports substring search and text indexing and suffixes are ordered lexicographically.
Both clues point to this choice.
Choose an option to check your answer.
A.
Suffix Tree
B.
Disjoint Set Union
C.
Dynamic Array
D.
Binary Search
Show Answer
Correct Answer: A. Suffix Tree
Explanation:
Suffix Tree is a compressed trie containing all suffixes of a string.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
sorting fixed-length integers or strings
B.
fast pattern matching
C.
analyzing balanced full trees
D.
teaching basic sorting mechanics
Show Answer
Correct Answer: B. fast pattern matching
Explanation:
Suffix Tree is commonly used for fast pattern matching.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
a query can combine results from a logarithmic number of nodes
B.
its merge step usually needs auxiliary storage for arrays
C.
it can support pattern search in time proportional to the pattern length
D.
a node can store multiple keys and have multiple children
Show Answer
Correct Answer: C. it can support pattern search in time proportional to the pattern length
Explanation:
The defining property is that it can support pattern search in time proportional to the pattern length.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
Bubble Sort
B.
Radix Tree
C.
Amortized Analysis
D.
Suffix Tree
Show Answer
Correct Answer: D. Suffix Tree
Explanation:
Suffix Tree fits because it supports fast pattern matching and it can support pattern search in time proportional to the pattern length.
Both clues point to this choice.
Choose an option to check your answer.
A.
Binary Search
B.
Graph
C.
Big-Theta Notation
D.
Counting Sort
Show Answer
Correct Answer: A. Binary Search
Explanation:
Binary Search is a searching algorithm that repeatedly halves a sorted search interval.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
Bloom Filter
B.
Max-Heap
C.
Priority Queue
D.
LRU Cache
Show Answer
Correct Answer: D. LRU Cache
Explanation:
LRU Cache fits because it supports bounded caching with temporal locality and it is commonly implemented using a hash map plus a doubly linked list.
Both clues point to this choice.
Choose an option to check your answer.
A.
Suffix Array
B.
Linear Probing
C.
Perfect Binary Tree
D.
Adjacency Matrix
Show Answer
Correct Answer: A. Suffix Array
Explanation:
Suffix Array is a sorted array of all suffix starting positions of a string.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
ordered searching and dynamic set operations
B.
substring search and text indexing
C.
memory management in managed runtimes
D.
function-call management and undo operations
Show Answer
Correct Answer: B. substring search and text indexing
Explanation:
Suffix Array is commonly used for substring search and text indexing.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
its subtrees do not become excessively skewed
B.
reachability analysis helps determine which objects can be reclaimed
C.
false positives are possible but false negatives are not under normal operation
D.
it provides excellent amortized decrease-key performance
Show Answer
Correct Answer: C. false positives are possible but false negatives are not under normal operation
Explanation:
The defining property is that false positives are possible but false negatives are not under normal operation.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
Quick Sort
B.
Quadratic Probing
C.
Fenwick Tree
D.
Bloom Filter
Show Answer
Correct Answer: D. Bloom Filter
Explanation:
Bloom Filter fits because it supports quickly rejecting items that are definitely absent and false positives are possible but false negatives are not under normal operation.
Both clues point to this choice.
Choose an option to check your answer.
A.
LRU Cache
B.
Trie
C.
Balanced Binary Tree
D.
B+ Tree
Show Answer
Correct Answer: A. LRU Cache
Explanation:
LRU Cache is a cache policy that evicts the least recently used item.
This description distinguishes it from the other choices.