Discussion
In the ............. traversal, we visit all of a vertex's descendants before we move on to an adjacent vertex.
Answer: B
This is depth first traversal.
Depth-first traversal goes as deep as possible along each branch: from a vertex it visits an unvisited neighbour, then that neighbour's descendants, and only after exhausting them backtracks to try the next adjacent vertex.
Breadth-first traversal does the opposite, visiting all adjacent vertices before going deeper. Inorder and preorder are particular orders for visiting the nodes of a binary tree, not the general graph traversal the question describes.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development