Practical tips debugging deep recursion?

前端 未结 8 1528
灰色年华
灰色年华 2021-02-13 06:44

I\'m working on a board game algorithm where a large tree is traversed using recursion, however, it\'s not behaving as expected. How do I handle this and what are you experience

8条回答
  •  失恋的感觉
    2021-02-13 07:08

    I would start by instrumenting the function(s). At each recursive call log the data structures and any other info that will be useful in helping you identify the problem.

    Print out the dump along with the source code then get away from the computer and have a nice paper-based debugging session over a cup of coffee.

提交回复
热议问题