Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Programming Questions: 1) All ______ begin and end at the same vertex and do

ID: 662610 • Letter: C

Question

C++ Programming Questions:

1) All ______ begin and end at the same vertex and do not pass through any other vertices more than once.

a) paths

b) simple paths

c) cycles

d) simple cycles

2) The edges in a ______ indicate a direction.

a) complete graph

b) multigraph

c) directed graph

d) spanning tree

3) If a graph has a directed edge from vertex x to vertex y, which of the following is true about x and y?

a) y is a predecessor of x

b) x is a successor of y

c) x is adjacent to y

d) y is adjacent to x

4) A graph-traversal algorithm stops when it ______.

a) first encounters the designated destination vertex

b) has visited all the vertices that it can reach

c) has visited all the vertices

d) has visited all the vertices and has returned to the origin vertex

5) In the following STL declaration of an adjacency list, what does the map pair represent?

a) vector<map<int, int> >adjList;

b) the first vertex (key) and the edge weight (value)

c) the second vertex (key) and the edge weight (value)

d) the first vertex (key) and the second vertex (value)

the first vertex (key) and the key (value)

Explanation / Answer

1.
c) cycles
a cycle is a path which starts and ends on the same vertex and no vertex is travelled more than once except the first one.

2.
c) directed graph
An edge in a directed graph has a direction pointing from 1 vertex to another.

3.
c) x is adjacent to y
d) y is adjacent to x

x is the direct predecessor, y is the direct successor

4.
d) has visited all the vertices and has returned to the origin vertex

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote