Introduction to Programming with C++, Third Edition, Y. Daniel Liang

This quiz is for students to practice. A large number of additional quiz is available for instructors using Quiz Generator from the Instructor's Resource Website. Videos for Java, Python, and C++ can be found at https://yongdanielliang.github.io/revelvideos.html.

Many questions in this edition have been updated in the new edition. Please check with the publisher on the newest edition.

Chapter 24 Graph Applications


24.1  The time complexity of the DFS algorithm is O(|E| + |V|).
A. true
B. false

24.2  A ____ is an edge that links a vertex to itself.
A. loop
B. parallel edge
C. weighted edge
D. directed edge

24.3  If two vertices are connected by two or more edges, these edges are called ______.
A. loop
B. parallel edge
C. weighted edge
D. directed edge

24.4  A _________ is the one in which every two pairs of vertices are connected.
A. complete graph
B. weighted graph
C. directed graph

24.5  What is the number of edges in a complete graph of n vertices?
A. n
B. n - 1
C. n(n-1)/2
D. n*n

24.6  What is the number of edges in a tree of n vertices?
A. n
B. n - 1
C. n(n-1)/2
D. n*n