Which of the following statements accurately describes a key difference between Depth-First Search (DFS) and Breadth-First Search (BFS)?
DFS is typically used for finding shortest paths in unweighted graphs, while BFS is used for cycle detection.
DFS explores a path as far as possible before backtracking, while BFS explores all neighbors at the current level before moving to the next level.
DFS uses a queue, while BFS uses a stack for traversal.
DFS is always more efficient than BFS in terms of time complexity.
In an undirected graph with 5 vertices, what is the maximum number of edges possible?
25
20
10
5
Adding an edge between two vertices in an undirected graph always:
Decreases the number of connected components.
May increase or decrease the number of connected components.
Increases the number of connected components.
Creates a cycle.
Which type of graph is MOST suitable for representing a one-way system on a city map?
Weighted Graph
Directed Graph
Tree
Undirected Graph
How does the iterative implementation of Depth-First Search (DFS) typically differ from its recursive counterpart?
The iterative approach is not suitable for traversing graphs with cycles.
The iterative and recursive approaches produce fundamentally different traversal orders.
The iterative approach uses a stack to mimic the function call stack used in recursion.
The iterative approach is generally less efficient in terms of space complexity than recursion.
Which data structure is commonly used to represent the order of visited vertices during a Depth-First Search?
Linked List
Queue
Stack
Heap
In an undirected graph with 5 vertices, what is the maximum number of edges you can add without creating a cycle?
6
4
Which of these scenarios is BEST represented using a weighted graph?
Storing the friendship relations between people on a social media platform.
Finding the shortest path between two cities on a road network with distances.
Representing the hierarchical structure of a company.
Modeling the flow of information in a computer network.
A cycle in a graph that is not a simple cycle (visits a vertex more than once) is called a:
Closed Walk
Trail
Path
Circuit
What data structure is typically used to implement the core of a Breadth-First Search (BFS) algorithm?