You are building a flight routing system. What graph algorithm can you use to find the cheapest flight itinerary with potentially multiple layovers?
Dijkstra's Algorithm
Depth-First Search (DFS)
Bellman-Ford Algorithm
A* Search Algorithm
Prim's algorithm for finding the MST starts with an arbitrary vertex. Does the choice of the starting vertex affect the final MST found?
No, the MST is unique for a given graph
Yes, different starting vertices may lead to different MSTs
Which of the following algorithms is typically used for topological sorting?
Kruskal's algorithm
Prim's algorithm
Dijkstra's algorithm
You are tasked with designing a system to schedule tasks with dependencies between them. What graph data structure would be most appropriate to represent these dependencies?
Undirected Graph
Bipartite Graph
Directed Acyclic Graph (DAG)
Complete Graph
Which algorithm is more suitable for finding the shortest path in a graph with negative edge weights?
Bellman-Ford algorithm
Kruskal's algorithm sorts edges in ascending order of their weights. What data structure is typically used for this sorting step?
Heap
Queue
Stack
Linked List
If you need to perform frequent edge insertions and deletions in a graph, which representation might be preferred?
It depends on the specific graph operations
Edge List
Adjacency Matrix
Incidence Matrix
Which representation would be most suitable for a graph where you primarily need to iterate over all edges efficiently?
Adjacency List
In a GPS navigation system, what graph algorithm is commonly used to find the shortest route between two locations represented as nodes on a road network?
Floyd-Warshall Algorithm
Topological Sort
In the context of Kruskal's algorithm, what data structure is commonly used to efficiently detect cycles during edge addition?
Disjoint Union Set (Union-Find)