Question

When debugging a recursive function that processes a `Tree` data structure, what is a common strategy to identify infinite recursion or incorrect base cases? 

A Increase the recursion depth limit.
B Use print statements to trace function calls and their parameters at each level.
C Convert the recursive function to an iterative one.
D Ignore the base case and focus only on the recursive step.
Practice Next

Hey! Ask a query