Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在阅读 Robert Sedwick 的 C++ 算法递归。如下所述
在根本不涉及整数参数的情况下,而是使用抽象的离散问题公式,它允许我们将问题分解为允许递归的较小问题。
请用例子解释作者所说的上述陈述是什么意思?
谢谢你的时间
例如快速排序- 问题中没有整数,而是一个“抽象”数组。 然而,每个递归步骤将问题分成 2 个较小的子问题。
另一方面,诸如递归斐波那契之类的问题-通过使用较小的整数递归调用,将问题简化为较小的问题。