Q. If a graph has 5 vertices and 10 edges, what is the maximum number of edges it can have?
Solution
In a simple undirected graph, the maximum number of edges is given by the formula V(V-1)/2, which for 5 vertices is 5(5-1)/2 = 10.
Correct Answer:
C
— 20
Learn More →
Q. What is the main difference between Dijkstra's algorithm and A* search algorithm?
-
A.
A* uses heuristics to improve efficiency
-
B.
Dijkstra's algorithm is faster
-
C.
A* can only be used on trees
-
D.
Dijkstra's algorithm is for unweighted graphs
Solution
The main difference is that A* uses heuristics to guide its search, making it more efficient in many cases compared to Dijkstra's algorithm.
Correct Answer:
A
— A* uses heuristics to improve efficiency
Learn More →
Showing 1 to 2 of 2 (1 Pages)