What is the degree of a vertex in a graph?
The number of self-loops on that vertex.
The total number of vertices in the graph.
The number of edges connected to that vertex.
The length of the longest path starting from that vertex.
You remove an edge from a connected graph. What is a possible consequence of this action?
The number of cycles in the graph will always decrease.
The graph may become disconnected.
The graph will always become disconnected.
The number of edges and vertices in the graph will decrease.
A cycle in a graph that is not a simple cycle (visits a vertex more than once) is called a:
Circuit
Closed Walk
Path
Trail
How does the iterative implementation of Depth-First Search (DFS) typically differ from its recursive counterpart?
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.
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.
Which type of graph is MOST suitable for representing a one-way system on a city map?
Directed Graph
Tree
Undirected Graph
Weighted Graph
Which of the following is the BEST representation of a graph when the number of edges is much smaller than the number of vertices?
Incidence Matrix
Edge List
Adjacency Matrix
Adjacency List
What does a '1' represent in an adjacency matrix of an undirected graph?
The weight of the edge.
The degree of the vertex.
The direction of the edge.
The presence of an edge between two vertices.
Which data structure is most efficient for checking if an edge exists between two vertices in a sparse graph?
Queue
Linked List
Which traversal algorithm is best suited for detecting cycles in a graph?
Breadth First Search (BFS)
Kruskal's Algorithm
Depth First Search (DFS)
Prim's Algorithm
Which of the following is an advantage of using an adjacency matrix representation for a graph?
Efficient for sparse graphs.
Faster to find all neighbors of a vertex.
Less memory usage for large graphs.
Constant time edge existence check.