Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. The Data structure used in standard implementation of Breadth First Search is?
  1.    Stack
  2.    Queue
  3.    Linked List
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Queue


The Breadth First Search explores every node once and put that node in queue and then it takes out nodes from the queue and explores it's neighbors.


Question 2. When the Breadth First Search of a graph is unique?
  1.    When the graph is a Binary Tree
  2.    When the graph is a Linked List
  3.    When the graph is a n-ary Tree
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> When the graph is a Linked List


When Every node will have one successor then the Breadth First Search is unique. In all other cases, when it will have more than one successor, it can choose any of them in arbitrary order.


Question 3. The Breadth First Search traversal of a graph will result into?
  1.    Linked List
  2.    Tree
  3.    Graph with back edges
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> Tree


The Breadth First Search will make a graph which don't have back edges (a tree) which is known as Breadth First Tree.


Question 4. What can be the applications of Breadth First Search?
  1.    Finding shortest path between two nodes
  2.    Finding bipartiteness of a graph
  3.    GPS navigation system
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


Breadth First Search can be applied to all of the mentioned problems. Bipartiteness of a graph means that a graph can be divided into two disjoint sets such that every edge connects a vertex in to one in.


Question 5. A person wants to visit some places. He starts from a vertex and then wants to visit every place connected to this vertex and so on. What algorithm he should use?
  1.    Depth First Search
  2.    Breadth First Search
  3.    Trim's algorithm
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Breadth First Search


This is the definition of the Breadth First Search. Exploring a node, then it's neighbors and so on.


Question 6. The Data structure used in standard implementation of Breadth First Search is?
  1.    Stack
  2.    Queue
  3.    Linked List
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Stack


The Depth First Search is implemented using recursion. So, stack can be used as data structure to implement depth first search.


Question 7. The Depth First Search traversal of a graph will result into?
  1.    Linked List
  2.    Tree
  3.    Graph with back edges
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Tree


The Depth First Search will make a graph which don't have back edges (a tree) which is known as Depth First Tree.


Question 8. What can be the applications of Depth First Search?
  1.    For generating topological sort of a graph
  2.    For generating Strongly Connected Components of a directed graph
  3.    Detecting cycles in the graph
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


Depth First Search can be applied to all of the mentioned problems.


Question 9. 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?
  1.    Depth First Search
  2.    Breadth First Search
  3.    Trim's algorithm
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Depth First Search


This is the definition of the Depth First Search. Exploring a node, then aggressively finding nodes till it is not able to find any node.


Question 10. When the Depth First Search of a graph is unique?
  1.    When the graph is a Binary Tree
  2.    When the graph is a Linked List
  3.    When the graph is a n-ary Tree
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> When the graph is a Linked List


When Every node will have one successor then the Depth First Search is unique. In all other cases, when it will have more than one successor, it can choose any of them in arbitrary order.


Latest Videos

Latest Test Papers