In a social network represented as a graph, what does the degree of a vertex signify?
The number of groups the user belongs to.
The number of friends or connections a user has.
The user's privacy settings.
The user's influence score.
You are performing a Breadth-First Search on a graph. Which of the following best describes the order in which vertices are visited?
Vertices at the same distance from the source vertex are visited before moving to vertices further away
Increasing order of their degree (number of connections)
Alphabetical order
Random order
What is a cycle in a graph?
A vertex with a degree of 1.
The longest path between any two vertices.
A graph that is not connected.
A path that starts and ends at the same vertex.
Which of the following is an advantage of using an adjacency matrix representation for a graph?
Efficient for sparse graphs.
Constant time edge existence check.
Faster to find all neighbors of a vertex.
Less memory usage for large graphs.
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?
Neither DFS nor BFS can determine if a path exists between two nodes.
Both DFS and BFS have the same efficiency for this task.
Depth-First Search (DFS)
Breadth-First Search (BFS)
Which traversal algorithm is best suited for detecting cycles in a graph?
Depth First Search (DFS)
Kruskal's Algorithm
Breadth First Search (BFS)
Prim's Algorithm
If every vertex in a graph has an even degree, what can we conclude about the graph?
It must be bipartite.
It must be directed.
It must be a tree.
It must have an Eulerian cycle.
In an undirected graph with 5 vertices, what is the maximum number of edges possible?
20
5
10
25
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
Adjacency List
Edge List
Adjacency Matrix
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.
Crawling and indexing web pages starting from a seed URL.
Simulating the spread of information or a virus in a social network.
Finding the shortest path between two locations on a map.