Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+9 votes

I'm a little bit confused about the totalSteps variable in the Iterative Deepening section. So, if the goal state is found at the 5th layer, would the answer look something like 1+2+3+4+5? If not, what should it be exactly?

asked in CSC320 by (8 points)

1 Answer

+7 votes

The total steps is the number of is the SUM of all the steps each DFS search took in every round, round is the return from the DFS when it comes back. You will add all of those up when up-till the solution is returned or not found. The overallMaxMemory is the LARGEST amount of memory that was during a single round. So if you had 5 layer. The totalSteps will be the sum of all numNodesCreated during each layer. The overallMaxMemory will be the larges memory(maxRoughMemoryCounter) that was used during one of the 5 layer, not the sum.

answered by (8 points)