快速准确地写递归的要点:
1、分清问题的子问题究竟是什么
2、实现最小子问题的解决方案
3、假设第n-1规模的问题已解决,写出第n规模问题的方案(这里的n不能理解为某个具体的数,而是该问题所有规模的通用表示,n可以等于1,也可以是问题的max,也可以是中间。
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
If you enjoyed what you read here, create your account today and start earning FREE STEEM!