Q. If a graph has 5 vertices and 7 edges, what is the maximum number of edges in a simple undirected graph?
Solution
In a simple undirected graph, the maximum number of edges is given by the formula V(V-1)/2. For 5 vertices, it is 5(5-1)/2 = 10.
Correct Answer:
A
— 10
Learn More →
Q. What is the main disadvantage of Dijkstra's algorithm?
-
A.
It is not optimal
-
B.
It requires a lot of memory
-
C.
It cannot handle negative weights
-
D.
It is too slow for large graphs
Solution
The main disadvantage of Dijkstra's algorithm is that it cannot handle graphs with negative weight edges, which can lead to incorrect results.
Correct Answer:
C
— It cannot handle negative weights
Learn More →
Showing 1 to 2 of 2 (1 Pages)