0% found this document useful (0 votes)
4 views2 pages

DSModule 5 Quiz 5

Uploaded by

vrt.kolluru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

DSModule 5 Quiz 5

Uploaded by

vrt.kolluru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

In graph theory, a graph is a set of:


A) Nodes only
B) Edges only
C) Nodes and edges
D) Trees and edges

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

3. Which of the following is true about a directed graph?


A) It contains cycles only.
B) It has directed edges between pairs of vertices.
C) It cannot have self-loops.
D) It must be connected.

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

5. Dijkstra’s algorithm is used to find the:


A) Longest path between two nodes
B) Shortest path between two nodes
C) Minimum spanning tree of a graph
D) Maximum flow in a network

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

9. The Floyd-Warshall algorithm is used to find:


A) The longest paths between all pairs of vertices
B) The shortest paths between all pairs of vertices
C) The minimum spanning tree of a graph
D) The maximum flow between two vertices

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

You might also like