Question: Question 6 : Graphs - Foraging for Rocks . . . . . . . . . . . . . . . . .
Question : Graphs Foraging for Rocks points
Suppose that a node of our undirected graph represents a clearing in a forest and an edge of our graph represents a trail between two clearings. For each node ie clearing we have a count of how many rocks are in that particular clearing.
In this problem, you're given an undirected graph and a node and you want to identify how many rocks can be reached by following paths from to other clearings. For example suppose the graph below was your input graph :
Examples: If your was the node above, you would find a total of rocks see the blue colored nodes Similarly, if your was the node above, you would find that there were a total of rocks. Finally, if your was the node above, you would find a total of rocks.
We define a graph as follows:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
