• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Quiz On Graph Data Structure

Question 1

Which of the following ways can be used to represent a graph?

  • Adjacency List and Adjacency Matrix

  • Incidence Matrix
     

  • Adjacency List, Adjacency Matrix and Incidence Matrix

  • None of the above

Question 2

For a given graph G having v vertices and e edges which is connected and has no cycles, which of the following statements is true?

  • v=e
     

  • v = e+1

  • v + 1 = e

  • v = e-1

Question 3

Which of the following is true?
 

  • A graph may contain no edges and many vertices

  • A graph may contain many edges and one vertex

  • A graph may contain no edges and no vertices

  • A graph may contain no vertices and many edges

Question 4

Time Complexity of DFS is? (V – number of vertices, E – number of edges)

  • O(V + E)

  • O(V)

  • O(E)

  • O(V*E)

Question 5

A person wants to visit some places. He starts from a vertex and then wants to visit every vertex till it finishes from one vertex, backtracks and then explore other vertex from same vertex. What algorithm he should use?

  • Depth First Search

  • Breadth First Search

  • Trim’s algorithm

  • Kruskal’s Algorithm

Question 6

A bridge cannot be a part of 

  • a simple cycle 

  • a tree

  • a clique with size>=3 whose every edge is a bridge

  • a graph which contains cycle

Question 7

Which of the following is the most commonly used data structure for implementing Dijkstra’s Algorithm?

  • Max priority queue

  • Stack

  • Circular queue

  • Min priority queue

Question 8

What is the time complexity of Dijkstra’s algorithm?

  • O(N)

  • O(N3)

  • O(N2)

  • O(logN)

Question 9

In most of the cases, topological sort starts from a node which has __________

  • Maximum Degree

  • Minimum Degree

  • Any degree

  • Zero Degree

Question 10

Topological sort can be implemented by?

  • Using Depth First Search

  • Using Breadth First Search

  • Using Depth and Breadth First Search

  • Using level ordered search

There are 10 questions to complete.

Last Updated :
Take a part in the ongoing discussion