What this quiz covers
This quiz focuses on Graph Representations, giving you a quick way to practice the rules, question types, and explanations that matter most for Discrete Math.
When converting from an adjacency list to an adjacency matrix for a graph with n vertices, which statement about space complexity is most accurate?
Discrete Math Quiz
Practice Graph Representations in Discrete Math with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.
This quiz focuses on Graph Representations, giving you a quick way to practice the rules, question types, and explanations that matter most for Discrete Math.
Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.
When converting from an adjacency list to an adjacency matrix for a graph with n vertices, which statement about space complexity is most accurate?
An adjacency list representation uses arrays where each vertex v maps to a sorted array of its neighbors. If vertex 1 maps to [2,4,5], vertex 2 maps to [1,3], vertex 3 maps to [2,5], vertex 4 maps to [1], and vertex 5 maps to [1,3], what is the value of entry (2,4) in the corresponding adjacency matrix?
A graph's adjacency matrix A has the property that Ai,j=1 if and only if vertices i and j are connected by an edge, and Ai,i=0 for all i. If the sum of row 3 is 4 and the sum of column 3 is 2, what can be concluded about the graph?
An undirected graph on 5 vertices has the adjacency list representation: v1:[v2,v4,v5], v2:[v1,v3,v5], v3:[v2,v4], v4:[v1,v3], v5:[v1,v2]. How many 1's appear in the upper triangular portion (above the main diagonal) of its adjacency matrix?
A weighted directed graph uses an adjacency matrix where Ai,j stores the weight of edge (i,j) if the edge exists, and ∞ if no edge exists. The matrix has finite entries at positions (1,2):5, (1,3):2, (2,3):1, (3,1):4, and ∞ elsewhere. How would vertex 2's adjacency list be represented using (neighbor, weight) pairs?
Consider the adjacency list representation where vertex A maps to [B,C,D], vertex B maps to [A,D], vertex C maps to [A], and vertex D maps to [A,B,E], but vertex E is missing from the representation. What should vertex E's adjacency list be to make this a valid undirected graph?
A complete bipartite graph K3,4 has vertex sets U={u1,u2,u3} and V={v1,v2,v3,v4} where every vertex in U connects to every vertex in V. In the adjacency list representation, what is the total length of all adjacency lists combined?
A directed graph has vertices {v1,v2,v3,v4} and edges {(v1,v2),(v1,v3),(v2,v4),(v3,v1),(v3,v4),(v4,v3)}. What is the sum of all entries in the adjacency matrix representation of this graph?
A graph's adjacency matrix has all zero entries on the main diagonal. After adding a self-loop to vertex 3, exactly one entry changes from 0 to 1. If the original matrix was symmetric, which property is preserved after adding the self-loop?
An adjacency matrix A for an undirected graph satisfies Ai,j2=number of paths of length 2 from vertex i to vertex j. If A has 1's at positions (1,2), (1,3), (2,1), (2,4), (3,1), (4,2) and 0's elsewhere, what is A1,42?
Consider an undirected multigraph (allowing multiple edges between the same pair of vertices) with adjacency matrix A where Ai,j equals the number of edges between vertices i and j. If converting to an adjacency list representation where each edge is listed separately, and vertex 3 has matrix row [0,2,0,1,3], how many entries will appear in vertex 3's adjacency list?
Consider converting between representations of a graph with n vertices and m edges. The adjacency matrix requires Θ(n2) space, while adjacency lists require Θ(n+m) space. For which type of graph do these space complexities become equal in order of magnitude?
A bipartite graph with vertex sets X={x1,x2,x3} and Y={y1,y2} has edges from each xi to every vertex in Y. If the vertices are ordered as x1,x2,x3,y1,y2 in the adjacency matrix, which pattern appears?
A programmer incorrectly implements an adjacency list by including each undirected edge only once (instead of twice) in the data structure. When this flawed adjacency list is converted back to an adjacency matrix, what property will the resulting matrix definitely have?
Consider the adjacency list representation: vertex 1: [2, 3], vertex 2: [1, 4], vertex 3: [1, 4], vertex 4: [2, 3, 5], vertex 5: [4]. In the corresponding adjacency matrix, how many entries are equal to 1?
Consider a directed graph where vertex 3's adjacency list is [1, 4, 1, 2]. When constructing the adjacency matrix representation, what constraint must be satisfied for this to be a valid simple directed graph?
Two different adjacency list representations of the same undirected graph are given: List A has vertex 3: [1, 2, 4] and List B has vertex 3: [4, 1, 2]. When converted to adjacency matrices using identical vertex orderings, how do the resulting matrices compare?
A graph G has the adjacency matrix $$A = \begin{pmatrix} 0 & 1 & 0 & 1 \ 1 & 0 & 2 & 0 \ 0 & 2 & 0 & 1 \ 1 & 0 & 1 & 0 \end{pmatrix}
An undirected graph has adjacency lists: vertex A: [B, C, D], vertex B: [A, D], vertex C: [A], vertex D: [A, B, E], vertex E: [D]. If we construct the adjacency matrix with vertices ordered alphabetically, what is the sum of all entries in the matrix?
A graph's adjacency matrix has exactly 3 ones in row 2 and exactly 2 ones in column 2. What can be definitively concluded about the graph?