4.9. 复杂的递归问题¶
4.9. Complex Recursive Problems
在前面的章节中,我们讨论了一些相对容易解决的问题,以及一些在图形上有趣的问题,这些问题可以帮助我们建立递归算法的心智模型。在本节及后续章节中,我们将探讨一些使用迭代编程风格难以解决,但使用递归方法却非常优雅且容易解决的问题。最后,我们会讨论一个看似拥有优雅递归解决方案,但实际上并非如此的“迷惑性”问题。
In the previous sections we looked at some problems that are relatively easy to solve and some graphically interesting problems that can help us gain a mental model of what is happening in a recursive algorithm. In this and the following sections we will look at some problems that are really difficult to solve using an iterative programming style but are very elegant and easy to solve using recursion. We will finish up by looking at a deceptive problem that at first looks like it has an elegant recursive solution but in fact does not.
最后更新:
2024年9月10日
创建日期: 2024年9月9日
创建日期: 2024年9月9日