Recall & Review
beginner
What is an adjacency matrix in graph representation?
An adjacency matrix is a 2D array used to represent a graph where each cell at row i and column j indicates if there is an edge between vertex i and vertex j.
Click to reveal answer
beginner
How do you represent no edge between two vertices in an adjacency matrix?
You represent no edge by placing 0 (zero) in the cell corresponding to those vertices in the adjacency matrix.
Click to reveal answer
beginner
What is the size of an adjacency matrix for a graph with n vertices?
The adjacency matrix size is n x n, where n is the number of vertices in the graph.
Click to reveal answer
intermediate
How does an adjacency matrix differ for directed and undirected graphs?
In a directed graph, the matrix is not necessarily symmetric because edges have direction. In an undirected graph, the matrix is symmetric because edges go both ways.
Click to reveal answer
beginner
What is the time complexity to check if an edge exists between two vertices using an adjacency matrix?
It is O(1) because you directly access the cell at row i and column j to check for an edge.
Click to reveal answer
What value is stored in an adjacency matrix cell if there is an edge between vertex 2 and vertex 3?
✗ Incorrect
A value of 1 indicates an edge exists between the two vertices.
What is the size of the adjacency matrix for a graph with 5 vertices?
✗ Incorrect
The adjacency matrix is always n x n where n is the number of vertices.
Which graph type has a symmetric adjacency matrix?
✗ Incorrect
Undirected graphs have symmetric adjacency matrices because edges go both ways.
What is the time complexity to check if an edge exists between two vertices using an adjacency matrix?
✗ Incorrect
Checking an edge is O(1) because it is a direct lookup in the matrix.
How is no edge represented in an adjacency matrix?
✗ Incorrect
A 0 indicates no edge between the vertices.
Explain how an adjacency matrix represents a graph and how to interpret its values.
Think of a table where rows and columns are vertices and cells show connections.
You got /5 concepts.
Describe the difference between adjacency matrices of directed and undirected graphs.
Consider if edges have direction or go both ways.
You got /4 concepts.