Once you hear that description, it's easy to write the code, in fact. This is a place where the recursive version of it is much easier to think about than the iterative one.
实际上一旦你听到了大致描述,就能很轻松的写出代码来,在这一点上应用递归来解决问题,比用迭代要容易理解多了。
麻省理工公开课 - 计算机科学及编程导论课程节选
应用推荐
模块上移
模块下移
不移动