开发者

Stack overflow and recursive method

开发者 https://www.devze.com 2023-04-10 10:24 出处:网络
开发者_如何学PythonGot a little silly question that I hope someone can answer me. When a stack overflow happens, how can a recursive method help in this problem?

开发者_如何学PythonGot a little silly question that I hope someone can answer me. When a stack overflow happens, how can a recursive method help in this problem?

Thanks


It's often the case that unbounded recursive methods cause stack overflow errors. One way to try to avoid this is to make the recursion converge and to use tail-call optimization (if your language supports it).

0

精彩评论

暂无评论...
验证码 换一张
取 消