递归特点:简而言之,递归就是应用程序调用自身。所以,存在预期收敛,才能使用递归(因为不能无限期递归调用下去)。优点:程序看着比较简单,比较容易实现。缺点:递归要占用额外的栈空间,如果递归的深度比较大,那么占用的栈比较多,而且调用函数的时间也比较多,时空性都不好。所以选择递归要考虑好处和缺点之间的权衡... Read More
posted @ 2014-07-29 20:31 Xylophone Views(1076) Comments(0) Diggs(0)
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ... Read More
posted @ 2014-07-29 11:31 Xylophone Views(150) Comments(0) Diggs(0)