• Home
  • Textbooks
  • Data Structures Using C
  • Nonlinear Data Structures: Graph

Data Structures Using C

Amol M. Jagtap, Ajit S. Mali

Chapter 6

Nonlinear Data Structures: Graph - all with Video Answers

Educators


Chapter Questions

Problem 1

Let us consider an unweighted graph G . Let a breadth-first traverse of G be done from a node r . Let $\mathrm{d}(\mathrm{r}, \mathrm{u})$ and $\mathrm{d}(\mathrm{r}, \mathrm{v})$ be the lengths of the shortest paths from $r$ to $u$ and $v$ respectively, in G . of $u$ is visited before $v$ during the breadth-first traversal, which of the following statements is correct?
A. $d(r, u)<d(r, v)$
B. $d(r, u)>d(r, v)$
C. $\mathbf{d}(\mathbf{r}, \mathbf{u})<=\mathbf{d}(\mathbf{r}, \mathbf{v})$
D. None of the above

Check back soon!

Problem 2

How many undirected graphs which are not necessarily connected can be formed out of a provided set $\mathrm{V}=\{\mathrm{V} 1, \mathrm{~V} 2, \ldots \mathrm{~V} \mathbf{n}\}$ of n vertices?
A. $n(n-1) / 2$
B. $2^{\wedge} \mathrm{n}$
C. n!
D. $\mathbf{2}^{\wedge}(\mathrm{n}(\mathrm{n}-1) / 2)$

Check back soon!

Problem 3

Which of the following statements is/are TRUE for an undirected graph?

P: Number of odd degree vertices is even
Q: The sum of degrees of all vertices is even
A. P Only
B. Q Only
C. Both P and Q
D. Neither P nor Q

Check back soon!

Problem 4

Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is $1 / 2$. What is the expected number of unordered cycles of length three?
A. A $1 / 8$
B. 1
C. 7
D. 8

Check back soon!

Problem 5

Given an undirected graph $G$ with $V$ vertices and $E$ edges, the sum of the degrees of all vertices is
A. E
B. 2E
C. V
D. 2 V

Check back soon!

Problem 6

How many undirected graphs (not necessarily connected) can be constructed out of a given set $V=\left\{v_1, v_2, \ldots v_n\right\}$ of $n$ vertices?
A. $\mathrm{n}(\mathrm{n}-1) /$
B. $2^{\mathrm{n}}$
C. $n$ !
D. $2^{\mathrm{n}(\mathrm{n}-1) / 2}$

Check back soon!

Problem 7

Let G be a weighted undirected graph and e be an edge with maximum weight in G. Suppose there is a minimum weight spanning tree in G containing the edge e. Which of the following statements is always TRUE?
A. There exists a cutset in $\mathbf{G}$ having all edges of maximum weight.
B. There exists a cycle in G having all edges of maximum weight
C. Edge e cannot be contained in a cycle.
D. All edges in $G$ have the same weight

Check back soon!

Problem 8

What is the largest integer m such that every simple connected graph with n vertices and n edges contains at least m different spanning trees?
A. 1
B. 2
C. 3
D. n

Check back soon!

Problem 9

Consider a directed graph with $n$ vertices and $m$ edges such that all edges have the same edge weights. Find the complexity of the best-known algorithm to compute the MST of the graph?
A. $\mathbf{O}(\mathrm{m}+\mathrm{n})$
B. $O(m \log n)$
C. $\mathrm{O}(\mathrm{mn})$
D. $O(n \log m)$

Check back soon!

Problem 10

For the undirected, weighted graph given below, which of the following sequences of edges represents a correct execution of Prim's algorithm to
construct an MST?
A. (a, b), (d, f), (f, c), (g, i), (d, a), (g, h), (c, e), (f, h)
B. (c, e), (c, f), (f, d), (d, a), (a, b), (g, h), (h, f), (g, i)
C. (d, f), (f, c), (d, a), (a, b), (c, e), (f, h), (g, h), (g, i)
D. (h, g), (g, i), (h, f), (f, c), (f, d), (d, a), (a, b), (c, e)

Check back soon!

Problem 11

What is the number of edges present in a complete graph having n vertices?
A. $\left(\mathrm{n}^*(\mathrm{n}+1)\right) / 2$
B. $\left(\mathbf{n}^*(\mathbf{n}-1)\right) / 2$
C. n
D. Information given is insufficient

Check back soon!

Problem 12

In the given graph, identify the cut vertices.
A. B and E
B. C and D
C. A and E
D. $C$ and $B$

Check back soon!

Problem 13

In a simple graph, the number of edges is equal to twice the sum of the degrees of the vertices.
A. True
B. False

Check back soon!

Problem 14

What is the maximum number of edges in a bipartite graph having 10 vertices?
A. 24
B. 21
C. 25
D. 16

Check back soon!

Problem 15

If a simple graph G , contains n vertices and m edges, the number of edges in the Graph G' (Complement of G) is $\qquad$
A. (n*n-n-2*m)/2
B. $\left(\mathrm{n}^* \mathrm{n}+\mathrm{n}+2^* \mathrm{~m}\right) / 2$
C. $\left(n^* n-n-2^* m\right) / 2$
D. $\left(n^* n-n+2 * m\right) / 2$

Check back soon!

Problem 16

A graph with all vertices having an equal degree is known as a $\qquad$
A. Multigraph
B. Regular graph
C. Simple graph
D. Complete graph

Check back soon!

Problem 17

Which of the following ways can be used to represent a graph?
A. Adjacency list and adjacency matrix
B. Incidence matrix
C. Adjacency list, adjacency matrix as well as incidence matrix
C. No way to represent

Check back soon!

Problem 18

Which of the following is true?
A. A graph may contain no edges and many vertices
B. A graph may contain many edges and no vertices
C. A graph may contain no edges and no vertices
D. A graph may contain no vertices and many edges

Check back soon!

Problem 19

The given Graph is regular.
A. True
B. False

Check back soon!

Problem 20

A connected planar graph having 6 vertices, 7 edges contain $\qquad$ regions.
A. 15
B. 3
C. 1
D. 11

Check back soon!

Problem 21

Which of the following statements is false or true?
1. If an undirected simple graph of ' $n$ ' vertices consists of $n(n-1) / 2$ number of edges then it is called a complete graph.
2. A simple digraph is said to be unilaterally connected if for any pair of nodes of a graph at least one of the nodes of a pair is reachable from the other node.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 are false
D. Statements 1 and 2 are true

Check back soon!