Recursion

本文深入探讨了递归编程的概念,从最简单的基础案例开始,通过实例和可视化帮助理解。逐步将复杂问题分解为更简单的子问题,概括出通用模式,并以此为基础编写代码。递归的核心是假设简单情况已解决,从而解决更复杂的问题。此外,还强调了接口使用和变量声明的重要性,以及如何在类中正确引用它们。
摘要由CSDN通过智能技术生成

recursion is solving a problem by using simpler version of that problem.

1.the simplest posiible input(Base case)
2.play around with examples and visualize
3.relate hard cases to simpler cases
4.generalize the pattern
5.write code by combining recursive pattern with the base case.

Recursive leap of faith: assume simpler cases work out.

character是’ ',String是 " "
String是串,字符是单个

不能用interface instantiate interface,需要用interface下面对应的类去instantiate

变量要写到类里面才能用class.xxx来引用,如果只写到constructor是不能引用的。并且必须将这个class实例化才能引用,没有实例化无法class.xxx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值