How does the iterative implementation of Depth-First Search (DFS) typically differ from its recursive counterpart?
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.
The iterative approach is not suitable for traversing graphs with cycles.
A graph is said to be __________ if there is a path from any vertex to any other vertex.
Complete
Connected
Disconnected
Bipartite
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 data structure is commonly used to represent the order of visited vertices during a Depth-First Search?
Queue
Heap
Linked List
Stack
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 B is adjacent to vertex A.
Vertex A is adjacent to vertex B.
Vertex A and B have the same degree.
Which of these scenarios is BEST represented using a weighted graph?
Modeling the flow of information in a computer network.
Representing the hierarchical structure of a company.
Finding the shortest path between two cities on a road network with distances.
Storing the friendship relations between people on a social media platform.
In a connected graph, a path that visits every edge exactly once is known as:
Eulerian Path
Hamiltonian Path
Shortest Path
Critical Path
Consider a graph where you want to find if a path exists between two given nodes. Which traversal algorithm would be generally more efficient for this task?
Breadth-First Search (BFS)
Both DFS and BFS have the same efficiency for this task.
Neither DFS nor BFS can determine if a path exists between two nodes.
Depth-First Search (DFS)
Which of the following is NOT a characteristic of a bipartite graph?
Vertices can be divided into two disjoint sets.
It can be used to model matching problems.
It can have an odd-length cycle.
Edges can only connect vertices from different sets.
What does a '1' represent in an adjacency matrix of an undirected graph?
The direction of the edge.
The weight of the edge.
The presence of an edge between two vertices.
The degree of the vertex.