Docsity

Graph Quiz: Implementing Graph Traversal Algorithm to Find Nodes at Specific Levels, Quizzes of Algorithms and Programming

Toggle sidebar
bg1
Graph Quiz – 01
1. Consider the below graph, you have to use appropriate graph traversal algorithm to show the
list of nodes or vertices that belongs to any particular level or depth.
Example: User will input the start node and particular level information, such as,
Input: Start node a, level 0; Output: a
Input: Start node a, level 1; Output: b, d
Input: Start node b, level 1; Output: c, e
Hints: First implement or represent a graph, use a graph class along with necessary member
variables and functions [Mark: 10]
Implement appropriate graph traversal algorithm (BFS or DFS) to show / perform required
output or task. First identify which algorithm you need to implement the above task.
[Mark: 10]
You can use one and only graph traversal slide. Not anything else, such as, internet or notes or else!
Good Luck

Partial preview of the text

Download Graph Quiz: Implementing Graph Traversal Algorithm to Find Nodes at Specific Levels and more Quizzes Algorithms and Programming in PDF only on Docsity!

Graph Quiz – 01

  1. Consider the below graph, you have to use appropriate graph traversal algorithm to show the list of nodes or vertices that belongs to any particular level or depth.

Example: User will input the start node and particular level information, such as,

 Input: Start node a , level 0 ; Output: a  Input: Start node a , level 1 ; Output: b, d  Input: Start node b , level 1 ; Output: c, e

Hints: First implement or represent a graph , use a graph class along with necessary member variables and functions [Mark: 10]  Implement appropriate graph traversal algorithm ( BFS or DFS ) to show / perform required output or task. First identify which algorithm you need to implement the above task. [Mark: 10]

You can use one and only graph traversal slide. Not anything else, such as, internet or notes or else!

Good Luck