Graph Search MCQ Quiz in తెలుగు - Objective Question with Answer for Graph Search - ముఫ్త్ [PDF] డౌన్‌లోడ్ కరెన్

Last updated on Mar 12, 2025

పొందండి Graph Search సమాధానాలు మరియు వివరణాత్మక పరిష్కారాలతో బహుళ ఎంపిక ప్రశ్నలు (MCQ క్విజ్). వీటిని ఉచితంగా డౌన్‌లోడ్ చేసుకోండి Graph Search MCQ క్విజ్ Pdf మరియు బ్యాంకింగ్, SSC, రైల్వే, UPSC, స్టేట్ PSC వంటి మీ రాబోయే పరీక్షల కోసం సిద్ధం చేయండి.

Latest Graph Search MCQ Objective Questions

Top Graph Search MCQ Objective Questions

Graph Search Question 1:

Given below are some algorithms, and some algorithm design paradigms.

1. Dijkstra’s Shortest Path

i. Divide and Conquer

2. Floyd-Warshall algorithm to compute all pairs shortest path

ii. Dynamic Programming

3. Binary search on a sorted array

iii. Greedy design

4. Backtracking search on a graph

iv. Depth-first search

 

v. Breadth-first search

 

Match the above algorithms on the left to the corresponding design paradigm they follow.

  1. 1 – i, 2 – iii, 3 – i, 4 – v.
  2. 1 – iii, 2 – iii, 3 – i, 4 – v.
  3. 1 – iii, 2 – ii, 3 – i, 4 – iv.
  4. 1 – iii, 2 – ii, 3 – i, 4 – v.

Answer (Detailed Solution Below)

Option 3 : 1 – iii, 2 – ii, 3 – i, 4 – iv.

Graph Search Question 1 Detailed Solution

  • Dijkstra’s Shortest Path uses the greedy method to find the shortest path of a graph G(V, E).
  • Floyd-Warshall algorithm uses dynamic programming approach to find all-pairs shortest paths of a graph G(V, E).
  • Binary search on a sorted array uses divide and conquer technique to search an element
  • Backtracking search on a graph is implemented using a depth-first search technique

Graph Search Question 2:

An undirected graph with n vertices and e edges are represented by adjacency matrix. The time required to determine the degree of any vertex is

  1. O(e)
  2. O(n)
  3. O(n2)
  4. O(e+n)

Answer (Detailed Solution Below)

Option 2 : O(n)

Graph Search Question 2 Detailed Solution

Given any vertex, Only scan of the particular row/particular column is required to get the in degree and out degree:

int find_deg(int v, int size, int mat[])

  {

     int sum = 0;

      for(int i = 0; i

      sum+=mat[v][i];

for(int i = 0; i< size ;i++)

      sum+=mat[i][v]

      return sum;

}

Hence complexity is O(n).

Graph Search Question 3:

Which of the following problems that use Depth First Search?

  1. Topological Sorting
  2. Detecting cycle in a graph
  3. Finding the negative weight cycle.
  4. Finding strongly connected components of a graph

Answer (Detailed Solution Below)

Option :

Graph Search Question 3 Detailed Solution

The correct answer is options 1, 2 and 4.

Concept:

Depth-first search:

An algorithm for exploring a graph is called depth-first search (DFS). DFS performs the traversal using a stack data structure. More than one DFS traversal may be performed on a graph.

Option 1: Topological Sorting.

Topological Sorting problem that uses the depth-first searchA directed graph's topological sort or topological order is a linear arrangement of its vertices where u comes before v for each directed edge (UV) connecting u and v. Every order of depth-first search order is a topological sort.

Option 2: Detecting cycle in a graph.

Detecting cycle in a graph that uses the depth-first search. Check back edges of each tree for cycles to find them. Keep track of the vertices that are currently in the recursion stack of the DFS traversal algorithm to find back edges. There is a cycle in the tree if a vertex that has previously been traversed by the recursion stack is reached.

Option 3: Finding the negative weight cycle.

Finding the negative weight cycle that uses Dynamic programming. Bellman-Ford algorithm that determines whether a negative cycle is present. Perform the Nth iteration of Bellman-Ford and choose a vertex from any edge that is loosened in this iteration to output the negative cycles. The negative cycle may be generated by using this vertex and its predecessors.

Option 4: Finding strongly connected components of a graph.

Finding strongly connected components of a graph uses the depth-first search. If there is a path connecting every vertex in a directed graph to every other vertex, the graph is said to be highly linked.

Hence the correct answer is to find the negative weight cycle.

Graph Search Question 4:

Which sequence cannot be obtained while using BFS traversal for the below given graph?

F2 R.S Pallavi 3.12.19 D1

I. A B C F G E D

II. A B C G F E D

III. A B D E C F G

  1. Only I
  2. Only II
  3. Only II and III
  4. I, II, III

Answer (Detailed Solution Below)

Option 4 : I, II, III

Graph Search Question 4 Detailed Solution

Concept:

Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures.

It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'), and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.

Explanation:

Since in all the option traversal start with node A, Therefore A is the root node

Statement I: A B C F G E D

A → B → C → F → G (not allowed)

∵ D is at distance 2 and G is at distance 3 from root node

Statement II: A B C G F E D

A → B → C → G (not allowed)

∵ D, E and F are at distance 2 and G is at distance 3 from the root node

Statement III: A B D E C F G

A→ B → D (not possible)

∵ C is at distance 1 and D is at distance 2 from the root node

Graph Search Question 5:

Consider a random binary tree on which Breadth First Search is applied starting from the root node. There exist a node x and y at the distance five from the root. If x is the nth node with a maximum possible value of n and y is the nth node with a minimum possible value of n in the Breadth First Search traversal. The value of x – y is _____.(Root node is 1st  node)

Answer (Detailed Solution Below) 31

Graph Search Question 5 Detailed Solution

Diagram: Consider that vertex is at distance 3 from the root, that is, height = 3

Traverse using BFS algorithm, number the node accordingly

F1 R.S Madhu 28.11.19 D1

Maximum value = x = 15

Minimum value = y = 8

∴ x – y = 15 – 8

(23+1 – 1) – 23 = (23+1 – 1) – 23 = 15 – 8 = 7

Shortcut:

In question h = 5,

(2h+1 – 1) – 2h = (25+1 – 1) – 25 = 31

Graph Search Question 6:

Consider the following graph. If BFS is implemented on the following graph then which of the following set of the nodes are present in the queue after performing 5th dequeue operation?(Root vertex is 1 and consider descending order while visiting the vertices.)

D147

  1. 2, 7, 6
  2. 2, 3, 4
  3. 3, 4, 6
  4. 8, 7, 6

Answer (Detailed Solution Below)

Option 1 : 2, 7, 6

Graph Search Question 6 Detailed Solution

Answer: Option 1

Explanation:

Enqueue node 1 in the queue.

Queue: 1

Mark it as visited. Dequeue 1 and enqueue its non-visited adjacent nodes in ascending order.

Queue: 8 5 4 3 2

Mark 8 as visited. Dequeue 8 and enqueue its non-visited adjacent nodes in ascending order.

Queue: 5 4 3 2 7 6

Mark 5 as visited. Dequeue 5 and enqueue its non-visited adjacent nodes.

Queue: 4 3 2 7 6

Mark 4 as visited. Dequeue 4 and enqueue its non-visited adjacent nodes.

Queue: 3 2 7 6

Mark 3 as visited. Dequeue 3 and enqueue its non-visited adjacent nodes.

Queue: 2 7 6

Hence Option is the correct answer.

Graph Search Question 7:

Total no. of nodes  required to represent the following tree using list representation :

Gate CS Algorithms Chapter-4 Images-Q3

  1. 15
  2. 12
  3. 20
  4. 19

Answer (Detailed Solution Below)

Option 3 : 20

Graph Search Question 7 Detailed Solution

Gate CS Algorithms Chapter-4 Images-Q3.1

Total no of nodes  = 20.

Graph Search Question 8:

How many topological orderings for the given graph?

F6 Madhuri Engineering 22.07.2022 D1

Answer (Detailed Solution Below) 4

Graph Search Question 8 Detailed Solution

The correct answer is 4.

Concept:

Topological orderings:

Topological sort is a linear arrangement of the vertices in such a way that if there is an edge in the DAG leading from vertex 'u' to vertex 'v', then 'u' comes before 'v' in the ordering.

Note:

  • Start a node whose in-degree is zero.
  • End a node whose out-degree is zero.

F6 Madhuri Engineering 22.07.2022 D1

Vertex Indegree Outdegree
A 0 2
1 2
C 1 2
D 2 2
E 2 0
F 2 0

There are four possible topological orderings for this graph:

F6 Madhuri Engineering 22.07.2022 D2

  • A B C D E F
  • A B C D F E
  • A C B D E F
  • A C B D F E

Hence the correct answer is 4.

Graph Search Question 9:

Consider the following graph.

F1 Madhu Engineering 08.06.22 D6

Assume node ‘S’ as the starting vertex for Prim’s algorithm. Which of the following can be the correct order of edges in which they are added to construct MST?

  1. 1,2,4,5,6,8,9
  2. 1,2,5,6,9,8
  3. 1,2,5,6,8,9
  4. None of the above

Answer (Detailed Solution Below)

Option 2 : 1,2,5,6,9,8

Graph Search Question 9 Detailed Solution

The correct answer is option 2.

Concept:

Prim’s algorithm:

Prim's Method is a greedy algorithm that finds the shortest spanning tree. It is comparable to the shortest path first algorithm. After a brief overview of the spanning trees, Spanning trees are a subset of Graphs that cover all vertices with the fewest possible edges.

Prim’s algorithm steps:

1) F1 Madhu Engineering 08.06.22 D7

2) F1 Madhu Engineering 08.06.22 D8

3) F1 Madhu Engineering 08.06.22 D9

4) F1 Madhu Engineering 08.06.22 D10

5) F1 Madhu Engineering 08.06.22 D11

6) F1 Madhu Engineering 08.06.22 D12

1,2,5,6,9,8 edges are added to the spanning tree. 

Hence the correct answer is 1,2,5,6,9,8.

Graph Search Question 10:

Match all items in Group 1 with the best match from the options given in Group 2.

Group 1 Group 2
 P. Min-and max-heaps  1. File system implementation
 Q. B-tress  2. Priority queue implementations
 R. Arrays  3. Expensive insertion and deletion operations
 S. Graphs  4. Electronic circuit design analysis

  1. P - 2, Q - 3, R - 4, S - 1
  2. P - 4, Q - 3, R - 2, S - 1
  3. P - 2, Q - 1, R - 3, S - 4
  4. P - 3, Q - 4, R - 1, S - 2

Answer (Detailed Solution Below)

Option 3 : P - 2, Q - 1, R - 3, S - 4

Graph Search Question 10 Detailed Solution

The correct answer is option 3.

Concept:

Min-and max-heaps:

It's either a Min Heap or a Max Heap is a Binary Heap. In a Min Binary Heap, the root key must be the smallest of all the keys in the Binary Heap. For all nodes in a Binary Tree, the same property must be true recursively. Similarly, with a Max Binary Heap, the root key must be the largest of all the keys in the Binary Heap. For all nodes in a Binary Tree, the same property must be true recursively.

Min heap and max-heap are implemented by a Priority queue. The default PriorityQueue is implemented with Min-Heap, that is the top element is the minimum one in the heap.

P. Min-and max-heaps = 2. Priority queue implementations.

B-tress:

A B-tree is a self-balancing tree data structure that keeps sorted data and permits logarithmic time searches, sequential access, insertions, and removals. B-tresses are used to implement a file system.

Q. B-tress= 1. File system implementation.

Arrays:

Insertion and Deletion operations are costlier since the memory locations are consecutive and fixed. Insertion and Deletion operations are fast and easy in a linked list.

R. Arrays= 3. Expensive insertion and deletion operations

Graphs:

The network graph is simply called a graph. It consists of a set of nodes connected by branches. In graphs, a node is a common point of two or more branches. Sometimes, only a single branch may connect to the node. A branch is a line segment that connects two nodes.

Any electric circuit or network can be converted into its equivalent graph by replacing the passive elements and voltage sources with short circuits and the current sources with open circuits. That means, the line segments in the graph represent the branches corresponding to either passive elements or voltage sources of the electric circuit.

S. Graphs= 4. Electronic circuit design analysis

Hence the correct answer is P - 2, Q - 1, R - 3, S - 4.

Get Free Access Now
Hot Links: teen patti star apk teen patti glory dhani teen patti teen patti master update