Algorithms II
Comprehensive Objective Assessment (Qns &
Ans)
2025
Multiple Choice Questions (MCQ)
Which of the following data structures is best suited to implement
a dynamic associative array (dictionary) with fast retrieval and
insertion for large datasets?
A) AVL Tree
B) Hash Table
C) Heap
©2025
,D) Queue ANS: B Rationale: Hash Tables provide O(1) average-
case time for insertion and retrieval, making them efficient for
dynamic associative arrays.
What is the primary reason for using B-trees in the
implementation of database indices?
A) Fast access to elements in main memory
B) Efficient storage in small devices
C) Balancing tree height for disk-based storage
D) Simple implementation ANS: C Rationale: B-trees minimize
disk I/O by maintaining a balanced height and reducing the
number of disk accesses.
The time complexity for a successful search in a Trie (prefix tree)
is:
A) O(log n)
B) O(1)
C) O(m)
D) O(n) ANS: C Rationale: Search operation in a Trie depends on
the length of the query string (m) and is independent of the
number of stored words.
Which algorithm is most appropriate for detecting cycles in a
directed graph?
©2025
, A) Breadth-First Search
B) Kruskal’s Algorithm
C) Depth-First Search with recursion stack
D) Union-Find Algorithm ANS: C Rationale: Using DFS with a
recursion stack can detect cycles in directed graphs efficiently.
Edmonds-Karp algorithm is an implementation of which method
for finding the maximum flow in a flow network?
A) Preflow-Push
B) Greedy Method
C) Ford-Fulkerson Method (using BFS)
D) Dijkstra’s Algorithm ANS: C Rationale: Edmonds-Karp uses
BFS as part of the Ford-Fulkerson method.
The amortized complexity of the ‘find’ operation in Union-Find
(Disjoint Set Union) with path compression and union by rank is:
A) O(1)
B) O(log n)
C) O(n)
D) O(α(n)) ANS: D Rationale: The operation runs in nearly
constant (inverse Ackermann function, α(n)) amortized time.
©2025