January 20, 2016
Plan to spend 2 hours
(9pm - 12pm) to read 10 blogs about algorithms, each blog 10 minutes.
1. Leetcode: Coin Change
http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/
Think about recursive function solution first, and then DP solution to remove redundant calculation
http://blog.csdn.net/kenden23/article/details/17636599http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/
Think about recursive function solution first, and then DP solution to remove redundant calculation
http://buttercola.blogspot.ca/2016/01/leetcode-coin-change.html
2. Leetcode: Maximum product of word lengths
https://www.hrwhisper.me/leetcode-maximum-product-of-word-lengths/
Brute force analysis, bit manipulation - encode string using integer, and then, optimize the algorithm - instead of two strings' comparison, using two integer bit manipulation - And operator - clever solution.
3. Leetcode questions: Power of 2 / Power of 3
http://www.cnblogs.com/grandyang/p/4623394.htmlPower of 3
http://my.oschina.net/Tsybius2014/blog/601048
4. Leetcode 325: Maximum size subarray sum to K (Level: easy)
https://asanchina.wordpress.com/2016/01/05/325-maximum-size-subarray-sum-equals-k/
January 21, 2016
5. BFS - algorithm
http://www.geeksforgeeks.org/find-number-of-islands/
Read the blog, understand the algorithm. Rate: 10
http://www.jiuzhang.com/solutions/find-the-connected-component-in-the-undirected-graph/
http://algobox.org/number-of-connected-components-in-an-undirected-graph/
http://www.geeksforgeeks.org/find-number-of-islands/
Read the blog, understand the algorithm. Rate: 10
http://www.jiuzhang.com/solutions/find-the-connected-component-in-the-undirected-graph/
http://algobox.org/number-of-connected-components-in-an-undirected-graph/
6. Sparse Matrix Multiplication
http://www.cs.cmu.edu/~scandal/cacm/node9.htmlhttps://leetcode.com/discuss/71912/easiest-java-solution
7. Leetcode 310: Minimum Height Trees
https://leetcode.com/problems/minimum-height-trees/#read the blog:
http://bookshadow.com/weblog/2015/11/26/leetcode-minimum-height-trees/
https://leetcode.com/discuss/71656/c-solution-o-n-time-o-n-space
http://likemyblogger.blogspot.ca/2015/11/leetcode-310-minimum-height-trees.html
8. Leetcode: Remove duplicate letters
http://bookshadow.com/weblog/2015/12/09/leetcode-remove-duplicate-letters/3 solutions are discussed in the following blog:
https://www.hrwhisper.me/leetcode-remove-duplicate-letters/
https://leetcode.com/discuss/73777/easy-to-understand-iterative-java-solution
9. Leetcode: Longest increasing subsequence
http://blog.csdn.net/kenden23/article/details/17632821spend 10 minutes to read the blog:
http://www.kancloud.cn/kancloud/data-structure-and-algorithm-notes/73075
http://www.geeksforgeeks.org/dynamic-programming-set-3-longest-increasing-subsequence/
Previous blog:
http://juliachencoding.blogspot.ca/2015/06/dynamic-programming-longest-increasing.html
Write some C# code for this algorithm later.
http://buttercola.blogspot.ca/2015/12/leetcode-longest-increasing-subsequence.html
NLogn solution, better than DP solution, Recursive solution
http://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/
Set Goals:
1. Know how to solve it using recursive solution first;
2. And then, understand DP solution, how to build the formula, avoid duplication;
3. And then, know where to find optimal solution here, O(nlogn),
10. Leetcode: Binary Tree Longest Consecutive Sequence
Excellent chance to practice recursive function
https://segmentfault.com/a/1190000003957798
No comments:
Post a Comment