In which scenario would a directed acyclic graph (DAG) be most suitable?
(A)
Representing dependencies between tasks in a project schedule
(B)
Modeling a social network with friend connections
(C)
Finding the shortest path between two nodes in a weighted graph
(D)
Performing breadth-first search (BFS) on a graph
Answer: (A)
Explanation:
Directed acyclic graphs (DAGs) are commonly used to represent dependencies between tasks in a project schedule. DAGs ensure that the tasks are organized in a way that no cycles exist, allowing for efficient scheduling and task sequencing.
Quiz of this Question
Please comment below if you find anything wrong in the above post