Practice Library
All MCQs
Browse exam-wise, subject-wise, and country-wise MCQs with explanations.
Choose an option to check your answer.
A.
Linear Search
B.
Red-Black Tree
C.
Quick Sort
D.
Fenwick Tree
Show Answer
Correct Answer: D. Fenwick Tree
Explanation:
Fenwick Tree fits because it supports prefix sums with updates and index movement is based on the least significant set bit.
Both clues point to this choice.
Choose an option to check your answer.
A.
reachability analysis helps determine which objects can be reclaimed
B.
each node stores two links
C.
index movement is based on the least significant set bit
D.
children are commonly called left and right
Show Answer
Correct Answer: C. index movement is based on the least significant set bit
Explanation:
The defining property is that index movement is based on the least significant set bit.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
describing both upper and lower growth rates
B.
prefix sums with updates
C.
efficient insertion or deletion when a node reference is available
D.
bounded caching with temporal locality
Show Answer
Correct Answer: B. prefix sums with updates
Explanation:
Fenwick Tree is commonly used for prefix sums with updates.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
Fenwick Tree
B.
Trie
C.
Quick Sort
D.
AVL Tree
Show Answer
Correct Answer: A. Fenwick Tree
Explanation:
Fenwick Tree is an indexed tree that stores partial cumulative information in an array.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
Bloom Filter
B.
Disjoint Set Union
C.
Suffix Array
D.
Segment Tree
Show Answer
Correct Answer: D. Segment Tree
Explanation:
Segment Tree fits because it supports range queries with point or range updates and a query can combine results from a logarithmic number of nodes.
Both clues point to this choice.
Choose an option to check your answer.
A.
after each full pass, an extreme element reaches its final region
B.
each digit pass must use a stable subroutine in common LSD implementations
C.
a query can combine results from a logarithmic number of nodes
D.
each node stores two links
Show Answer
Correct Answer: C. a query can combine results from a logarithmic number of nodes
Explanation:
The defining property is that a query can combine results from a logarithmic number of nodes.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
sorting fixed-length integers or strings
B.
range queries with point or range updates
C.
fast average-case dictionary operations
D.
modeling networks, routes, and relationships
Show Answer
Correct Answer: B. range queries with point or range updates
Explanation:
Segment Tree is commonly used for range queries with point or range updates.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
Segment Tree
B.
Big-Theta Notation
C.
Big-Omega Notation
D.
Hash Table
Show Answer
Correct Answer: A. Segment Tree
Explanation:
Segment Tree is a binary tree structure storing aggregate information over intervals.
This description distinguishes it from the other choices.
Choose an option to check your answer.
A.
Adjacency Matrix
B.
Bloom Filter
C.
Binary Search
D.
Union by Rank
Show Answer
Correct Answer: D. Union by Rank
Explanation:
Union by Rank fits because it supports keeping union-find trees short and rank approximates tree height.
Both clues point to this choice.
Choose an option to check your answer.
A.
its running time depends on both item count and key range
B.
elements are typically stored in adjacent memory locations
C.
rank approximates tree height
D.
a query can combine results from a logarithmic number of nodes
Show Answer
Correct Answer: C. rank approximates tree height
Explanation:
The defining property is that rank approximates tree height.
The other statements describe different structures or concepts.
Choose an option to check your answer.
A.
frequent insertions at the head
B.
keeping union-find trees short
C.
immediate reclamation when the count reaches zero
D.
ordered dictionary operations with expected logarithmic time
Show Answer
Correct Answer: B. keeping union-find trees short
Explanation:
Union by Rank is commonly used for keeping union-find trees short.
Its design supports this task efficiently or naturally.
Choose an option to check your answer.
A.
Union by Rank
B.
Binomial Heap
C.
Binary Search
D.
Bloom Filter
Show Answer
Correct Answer: A. Union by Rank
Explanation:
Union by Rank is a disjoint-set optimization that attaches the shallower tree under the deeper tree.
This description distinguishes it from the other choices.