Data Structure Questions and Answers-Depth First Search

DOWNLOAD FREE PDF <<CLICK HERE>>

Data Structure Questions and Answers-Depth First Search

Congratulations - you have completed Data Structure Questions and Answers-Depth First Search.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%


Your answers are highlighted below.
Question 1 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Depth First Search is equivalent to which of the traversal in the Binary Trees?
A
Pre-order Traversal
B
Post-order Traversal
C
Level-order Traversal
D
In-order Traversal
Question 1 Explanation: 
In Depth First Search, we explore all the nodes aggressively to one path and then backtrack to the node. Hence, it is equivalent to the pre-order traversal of a Binary Tree.

Question 2 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Time Complexity of DFS is? (V - number of vertices, E - number of edges)
A
O(V + E)
B
O(V)
C
O(E)
D
None of the mentioned
Question 2 Explanation: 
The Depth First Search explores every node once and every edge once (in worst case), so it's time complexity is O(V + E).

Question 3 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
The Data structure used in standard implementation of Breadth First Search is?
A
Stack
B
Queue
C
Linked List
D
None of the mentioned
Question 3 Explanation: 
The Depth First Search is implemented using recursion. So, stack can be used as data structure to implement depth first search.

Question 4 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
The Depth First Search traversal of a graph will result into?
A
Linked List
B
Tree
C
Graph with back edges
D
None of the mentioned
Question 4 Explanation: 
The Depth First Search will make a graph which don't have back edges (a tree) which is known as Depth First Tree.

Question 5 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
A person wants to visit some places. He starts from a vertex and then wants to visit every vertex till it finishes from one verte, x backtracks and then explore other vertex from same vertex. What algorithm he should use?
A
Depth First Search
B
Breadth First Search
C
Trim's algorithm
D
None of the mentioned
Question 5 Explanation: 
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.

Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 5 questions to complete.

DOWNLOAD FREE PDF <<CLICK HERE>>