Practice Library
All MCQs
Browse exam-wise, subject-wise, and country-wise MCQs with explanations.
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.
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.
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.
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.
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.
it flattens the parent structure over time
B.
the function is bounded above and below by constant multiples
C.
suffixes are ordered lexicographically
D.
it may examine every element
Show Answer
Correct Answer: C. suffixes are ordered lexicographically
Explanation:
The defining property is that suffixes are ordered lexicographically.
The other statements describe different structures or concepts.
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.
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.
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.
its space usage is proportional to vertices plus edges
B.
cycles can prevent unreachable objects from being reclaimed
C.
it is commonly implemented using a hash map plus a doubly linked list
D.
it does not naturally support frequent updates
Show Answer
Correct Answer: C. it is commonly implemented using a hash map plus a doubly linked list
Explanation:
The defining property is that it is commonly implemented using a hash map plus a doubly linked list.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
sparse graphs
B.
bounded caching with temporal locality
C.
analyzing balanced full trees
D.
efficient insertion or deletion when a node reference is available
Show Answer
Correct Answer: B. bounded caching with temporal locality
Explanation:
LRU Cache is commonly used for bounded caching with temporal locality.
Its design supports this task efficiently or naturally.
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.