感觉linkedlist用那个dummy node很好用 其实能用dp的题很多吧,只是有的太普通了看上去就只是一般的循环。 最近总结的: e.g.1 Climbing takes n steps to reach to the top. Each time you can either climb 1 or 2 or 3 steps. In how many distinct ways can you climb to the top? ( CtCI 9.1 ,Leetcode: Climbing Stairs) e.g.2 How many paths are there for the robot to go from (0,0) to (x,y) ( CtCI 9.2, Leetcode: Unique Path) e.g.3 Write a method to return all subsets of a set. ( CtCI 9.4 ) e.g.4 Write a method to compute all permutations of a string. ( CtCI 9.5) e.g.5 Letter Combinations of a Phone Number.( Leetcode: http://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/) e.g.6 Longest increasing subsequence of an array.( CtCI 11.7 ) e.g.7 Given the heights of each person in the circus, compute the largest possible number of people in tower. ( CtCI 11.7) e.g.8 Compute the Nth prime ( Ebay interview ) e.g.9 Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. ( Leetcode: Word Break ) e.g.10 Generate a list of primes using The Sieve of Eratosthenes 这些我认为其实都是dp问题。