• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Graph Data Strcuture with Answers

Question 1

The degree sequence of a simple graph is the sequence of the degrees of the nodes in the graph in decreasing order. Which of the following sequences can not be the degree sequence of any graph? 
 

I. 7, 6, 5, 4, 4, 3, 2, 1
II. 6, 6, 6, 6, 3, 3, 2, 2
III. 7, 6, 6, 4, 4, 3, 2, 2
IV. 8, 7, 7, 6, 4, 2, 1, 1 


 

  • I and II

  • III and IV

  • IV only

  • II and IV

Question 2

The time complexity of computing the transitive closure of a binary relation on a set of n elements is known to be:

  • O(n)

  • O(nLogn)

  • O(n ^ (3/2))

  • O(n^3)

Question 3

The most efficient algorithm for finding the number of connected components in an undirected graph on n vertices and m edges has time complexity.

  • theta(n)

  • theta(m)

  • theta(m + n)

  • theta(mn)

Question 4

Consider an undirected unweighted graph G. Let a breadth-first traversal of G be done starting from a node r. Let d(r, u) and d(r, v) be the lengths of the shortest paths from r to u and v respectively, in G. lf u is visited before v during the breadth-first traversal, which of the following statements is correct?

  • d(r, u) < d (r, v)

  • d(r, u) > d(r, v)

  • d(r, u) <= d (r, v)

  • None of the above

Question 5

How many undirected graphs (not necessarily connected) can be constructed out of a given set V= {V 1, V 2,…V n} of n vertices ?
  • n(n-l)/2
  • 2^n
  • n!
  • 2^(n(n-1)/2)

Question 6

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

P: The number of odd-degree vertices is even 

Q: Sum of degrees of all vertices is even

  • P Only

  • Q Only

  • Both P and Q

  • Neither P nor Q

Question 7

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?
  • 1/8
  • 1
  • 7
  • 8

Question 8

In which scenario would a directed acyclic graph (DAG) be most suitable?

  • Representing dependencies between tasks in a project schedule

  • Modeling a social network with friend connections

  • Finding the shortest path between two nodes in a weighted graph

  • Performing breadth-first search (BFS) on a graph

Question 9

How many undirected graphs (not necessarily connected) can be constructed out of a given set V = {v1, v2, ... vn} of n vertices?
  • n(n-1)/2
  • 2n
  • n!
  • 2n(n-1)/2

Question 10

What is the maximum number of edges in an acyclic undirected graph with n vertices?
  • n-1
  • n
  • n + 1
  • 2n-1

There are 38 questions to complete.

Last Updated :
Take a part in the ongoing discussion