Which statement correctly describes an adjacency matrix for a graph?
10 Trees and Graph Algorithms Online Quiz Questions
Use this free practice quiz with 20 questions to review 10 Trees and Graph Algorithms, test your knowledge, and prepare for your next test or exam.
Adding any new edge to a tree creates exactly one cycle.
- A
True
- B
False
What is the term for the vertex immediately next to a given vertex on the path toward the root?
Breadth-first search uses a to process vertices in level order.
Which description best defines a spanning tree of a connected graph?
- A
A subgraph containing only vertices of odd degree
- B
A subgraph containing every vertex and forming a tree
- C
A subgraph containing every edge of the original graph
- D
A cycle with minimum total edge weight
A rooted tree has root r with children a and b; a has children c and d; b has child e. Select all statements that are true.
- A
c and d are siblings.
- B
e is a child of b.
- C
a and b are siblings of c.
- D
r is an ancestor of c.
In a rooted tree, r is the root; r has children a and b; a has children c and d; and b has child e. What is the height of the tree?
Which action is characteristic of Kruskal's minimum-spanning-tree algorithm?
- A
It repeatedly chooses the vertex with the greatest degree.
- B
It starts from one vertex and always expands through that vertex's cheapest incident edge.
- C
It sorts edges by increasing weight and adds an edge when it connects different components.
- D
It performs BFS and records the first edge used to reach each vertex.
A directed cycle prevents a topological ordering from existing.
- A
True
- B
False
Which of the following are applications of decision trees? Select all correct choices.
- A
Classification
- B
Diagnosis
- C
Game strategies
- D
Program control flow
Explain the main operational difference between breadth-first search and depth-first search. Include the usual adjacency-list running time of each and one task for which either method is especially suitable.
Which test correctly determines whether a connected undirected graph with n vertices is a tree?
- A
Check only whether every vertex has degree at most two.
- B
Check whether the graph has at least n edges.
- C
Check that the graph is connected, has n-1 edges, and contains no cycle.
- D
Check whether a BFS visits vertices in alphabetical order.
Which condition defines a binary tree?
- A
Every vertex has exactly two children.
- B
Every vertex has at most two children.
- C
Every leaf has exactly two parents.
- D
All vertices must lie at the same depth.
An undirected graph is known to be a tree with 9 vertices. How many edges must it have?
- A
7
- B
8
- C
9
- D
10
In an unweighted graph, breadth-first search can find a shortest path from a source vertex to every reachable vertex.
- A
True
- B
False
Which minimum-spanning-tree algorithm sorts all edges by increasing weight and adds an edge whenever it joins two previously disconnected components?
For a graph with vertices A,B,C,D and edges AB,AC,BC,BD,CD, which edge set is a spanning tree?
- A
AB,AC,BC
- B
AB,BC,CA,AD
- C
AB,AC,BD,CD
- D
AB,AC,BC,BD,CD
In a rooted tree, r is the root, b is a child of r, and e is a child of b. What is the depth of e?
- A
0
- B
2
- C
3
- D
4
An unweighted graph has edges s−a, s−b, a−c, b−d, c−x, and d−x. What shortest-path distance does BFS assign from s to x, measured in edges?
During depth-first search of an undirected graph, encountering an already visited neighbor that is not the current vertex's indicates that the graph contains a cycle.
Related study packs and tools
2 Limits and Continuity
A progressive guide to interpreting, calculating, and applying limits, asymptotes, continuity, and the Intermediate Value Theorem.
02/14 2. Linear Equations and Applications
A progressive guide to solving linear equations, rearranging formulas, using proportions and percents, and modeling everyday applications with equations.
4 Polar Coordinates
A progressive guide to converting, graphing, differentiating, and integrating polar curves, with emphasis on symmetry, intersections, area, and arc length.
05 Multiple Integrals
A medium-difficulty quiz on double and triple integrals, including regions of integration, applications, density, average value, moments, and integral setup.
5 Sequences
A 14-question quiz on sequences, sequence limits, monotonicity, boundedness, convergence criteria, the Squeeze Theorem, limit laws, and recursive sequences. Questions progress from foundational understanding to applied reasoning.
5 Sequences
A structured guide to defining sequences, evaluating their limits, and proving convergence or divergence using limit laws, bounds, monotonicity, the Squeeze Theorem, and recursive methods.
5 Vector Spaces
A structured guide to vector spaces, subspaces, spans, independence, bases, dimension, and coordinates, with definitions, tests, examples, and a unified problem-solving workflow.
7 Eigenvalues and Eigenvectors
A progressive guide to identifying eigenvalues and eigenvectors, computing eigenspaces, comparing algebraic and geometric multiplicities, and determining when a matrix can be diagonalized.
7 Power Series and Taylor Series
A 14-question assessment on power series, convergence, term-by-term operations, Taylor and Maclaurin series, polynomial approximation, and error bounds. The questions progress from foundational interpretation to applied convergence and approximation problems.
7 Power Series and Taylor Series
A progressive guide to representing functions with power and Taylor series, determining convergence, manipulating series, and controlling approximation error.
09/14 9. Rational Expressions and Functions
A structured guide to simplifying rational expressions, solving rational equations, analyzing rational functions, graphing their key features, and applying them to rates, work, and cost models.
12 Applications of Multivariable Calculus
A connected guide to modeling geometry, motion, mass, fields, work, flux, and optimization with the main tools of multivariable calculus.