22. Graphs and Applications - 9 Questions

# 22. Graphs and Applications

9 Questions
Created by Y. Daniel Liang
Free
##### This Python quiz is aimed at students, enthusiasts and job seekers with little or no programming experience. It aims to provide them with an understanding of the role of computers and python programming language.
1. A ____ is an edge that links a vertex to itself.

loop
parallel edge
weighted edge
directed edge

2. If two vertices are connected by two or more edges, these edges are called ______.

loop
parallel edge
weighted edge
directed edge

3. A _________ is the one in which every two pairs of vertices are connected.

complete graph
incomplete graph
weighted graph
directed graph

4. What is the number of edges in a complete graph of n vertices?

n
n - 1
n(n-1)/2
n*n

5. What is the number of edges in a tree of n vertices?

n
n - 1
n(n-1)/2
n*n

6. The _______ search of a graph first visits a vertex, then it recursively visits all the vertices adjacent to that vertex.

depth-first
depth-last

7. The _______ the breadth-first search of a graph first visits a vertex, then all its adjacent vertices, then all the vertices adjacent to those vertices, and so on.

depth-first
depth-last

8. The time complexity of the DFS algorithm is O(|E| + |V|).

True
False
Can't say
none of these