edited by
1,010 views
0 votes
0 votes

The Depth First and Breadth First Traversal algorithms visit the nodes in exactly the same order in which the following types of graphs

  1. Binary tree
  2. Linear chain
  3. Complete graph
  4. None of the above
edited by

1 Answer

2 votes
2 votes

Linked List is a linear data structure and it is very common data structure which consists of group of nodes in a sequence which is divided in two parts. Each node consists of its own data and the address of the next node and forms a chain.

So , in linear Chain only sequential access will be possible and both BFS and DFS will give same traversal outputs

So, B should be correct.

Tell me...if i am wrong..

Related questions

3 votes
3 votes
2 answers
1
suchismith roy asked May 27, 2016
2,126 views
DFS is done for a graph.So we need a visited array to keep track of cycles.Do we need visited array for DFT of a tree?What is the basic difference between traversal and s...
2 votes
2 votes
1 answer
2
arya_stark asked Jul 4, 2018
7,281 views
Preorder is same as :a) depth-first order b) breadth-first searchc) topological order d) linear order
0 votes
0 votes
1 answer
3
eyeamgj asked Jun 19, 2018
1,253 views
2 votes
2 votes
0 answers
4
Pawan Kumar 2 asked Jan 13, 2018
495 views
If we backtrack in DFS ,then doesn't statement 1 becomes true ?