递归的使用

来源:互联网 发布:贪吃蛇java代码详解 编辑:程序博客网 时间:2024/05/17 16:45

在introduction to algorithms中(第2章算法基础之设计算法和第4章分治策略),递归在前面的分治策略中用的居多,这当然是一种应用

在考虑回溯的时候,即走一步,然后在退一步的时候,递归也是很适用的。如leetcode中https://leetcode.com/problems/distinct-subsequences/

0 0
原创粉丝点击