What is the primary use of a priority queue in graph algorithms?
A. To store all vertices of the graph.
B. To keep track of the visited nodes.
C. To efficiently manage and retrieve the minimum or maximum element.
D. To represent the adjacency matrix.
Answer: Option C
What is the primary difference between a directed graph and an undirected graph?
A. A directed graph has nodes with unique identifiers, while an undirected graph does not.
B. A directed graph has edges with direction, while an undirected graph does not.
C. There is no difference between them.
D. A directed graph has nodes with unique identifiers, while an undirected graph does not.
A. O(V log V)
B. O(E)
C. O(V2)
D. O(V + E)
Which of the following is true about a bipartite graph?
A. It contains a cycle of odd length.
B. It can be represented using only one adjacency list.
C. It has no edges.
D. It can be colored using two colors such that no two adjacent vertices share the same color.
A. A path that starts and ends at the same vertex with no other repetitions.
B. A path that includes all vertices exactly once.
C. A path with no edges.
D. A complete traversal of all vertices.

Join The Discussion