Adding an edge between two vertices in an undirected graph always:
May increase or decrease the number of connected components.
Decreases the number of connected components.
Creates a cycle.
Increases the number of connected components.
A graph is said to be __________ if there is a path from any vertex to any other vertex.
Bipartite
Disconnected
Complete
Connected
In a directed graph, if vertex A has an outgoing edge to vertex B, then:
There must be an edge from vertex B to vertex A.
Vertex A and B have the same degree.
Vertex A is adjacent to vertex B.
Vertex B is adjacent to vertex A.
Which of the following graph algorithms is best suited for finding the shortest path in a weighted graph?
Dijkstra's Algorithm
Depth-First Search
Breadth-First Search
Topological Sort
Which graph traversal algorithm uses a queue to visit vertices?
Depth First Search (DFS)
Breadth First Search (BFS)
Bellman-Ford Algorithm
Which of these scenarios is BEST represented using a weighted graph?
Modeling the flow of information in a computer network.
Storing the friendship relations between people on a social media platform.
Representing the hierarchical structure of a company.
Finding the shortest path between two cities on a road network with distances.
Which of the following scenarios is particularly well-suited for applying a Depth-First Search (DFS) algorithm?
Solving mazes or navigating through grid-based environments.
Finding the shortest path between two locations on a map.
Simulating the spread of information or a virus in a social network.
Crawling and indexing web pages starting from a seed URL.
Which of the following is the BEST representation of a graph when the number of edges is much smaller than the number of vertices?
Edge List
Incidence Matrix
Adjacency List
Adjacency Matrix
How does the iterative implementation of Depth-First Search (DFS) typically differ from its recursive counterpart?
The iterative approach is generally less efficient in terms of space complexity than recursion.
The iterative approach is not suitable for traversing graphs with cycles.
The iterative approach uses a stack to mimic the function call stack used in recursion.
The iterative and recursive approaches produce fundamentally different traversal orders.
Which traversal algorithm is best suited for detecting cycles in a graph?
Kruskal's Algorithm
Prim's Algorithm