Which of the following graph traversals closely imitates level order traversal of a binary tree?

Category: QuestionsWhich of the following graph traversals closely imitates level order traversal of a binary tree?
Editor">Editor Staff asked 4 weeks ago

Which of the following graph traversals closely imitates level order traversal of a binary tree?
 
(a) Depth First Search
 
(b) Breadth First Search
 
(c) Depth & Breadth First Search
 
(d) Binary Search
 
This intriguing question comes from Inorder Traversal in portion Binary Trees of Data Structures & Algorithms I
 
I got this question by my college professor while I was bunking the class.

1 Answers
Editor">Editor Staff answered 4 weeks ago

Correct option is (b) Breadth First Search
 
Best explanation: Both level order tree traversal and breadth first graph traversal follow the principle that visit your neighbors first and then move on to further nodes.