DSModule 5 Quiz 5
DSModule 5 Quiz 5
2. Which of the following data structures is commonly used to represent a graph with sparse
connections?
A) Adjacency Matrix
B) Adjacency List
C) Incidence Matrix
D) Linked List
4. In a Breadth-First Search (BFS) traversal of a graph, which data structure is typically used to keep
track of the vertices to be explored?
A) Stack
B) Queue
C) Priority Queue
D) Deque
6. Which of the following algorithms is NOT used for finding the shortest path in a graph?
A) Dijkstra's Algorithm
B) Floyd-Warshall Algorithm
C) Prim's Algorithm
D) Bellman-Ford Algorithm
7. What is the time complexity of Prim’s algorithm when using a priority queue and an adjacency
list?
A) O(V^2)
B) O(E log V)
C) O(V log V)
D) O(E + V log V)
8. In Kruskal’s algorithm for finding the minimum spanning tree, which data structure is crucial for
detecting cycles?
A) Queue
B) Disjoint Set (Union-Find)
C) Stack
D) Priority Queue
10. In an undirected graph, if there is a path between every pair of vertices, the graph is called:
A) Directed
B) Weighted
C) Connected
D) Acyclic