• LintCode "最长公共子序列(Longest Common Sequence)"

    It’s not on the LeetCode, but on the LintCode. LintCode link first thought Use DP, build a matrix dp to represent the maximum number with the substring of a ...

    LeetCode "300. Longest Increasing Subsequence"

    LeetCode link first thought DP. Using 1d array to record the maximum length of sequence of each number when the number is the last number in the sequence. Ge...

    LeetCode "64. Minimum Path Sum"

    LeetCode link first thought use dp from top left add to bottom right. can be solved by using only a 1d array solution 123456789101112131415161718192021class...

    动态规划(DP)

    关键点 确定好问题的变量及之间的关系 确定好问题的规模(即 new 一个几维的数组,每个维度代表什么) 确定好问题的初始情况(类似于DFS的base case) 确定好问题的表达式(类似于DFS的递归函数处的处理,如 fibonacci(n) = fibonacci(n-1)+fibonacci(n-2) 对应的...

    XPC

    管理进程间的安全通信。 主题 XPC 客户端(XPC Client)1protocol NSXPCProxyCreating 创建新的代理(proxy)对象的方法。 1class NSXPCConnection 两个进程间的双向通信通道。 1class NSXPCInterface 一个可以发送到导出对象(ex...

    LeetCode "301. Remove Invalid Parentheses"

    LeetCode link first thought have no idea… it can be also solved by dfs, but I think bfs cost less, so just use bfs. Have seen the answer. Because the problem...

    LeetCode "515. Find Largest Value in Each Tree Row"

    LeetCode link first thought DFS DFS solution 123456789101112131415161718192021public class Solution { public List<Integer> largestValues(TreeN...

    LeetCode "199. Binary Tree Right Side View"

    LeetCode link first thought DFS. solution1 1234567891011121314151617181920212223public class Solution { public List<Integer> rightSideView(Tre...

    LeetCode "513. Find Bottom Left Tree Value"

    LeetCode link first thought BFS. Two queue to iterate, update the result when finish one level. solution 1234567891011121314151617181920212223class Solution...

    LeetCode "200. Number of Islands"

    LeetCode link first thought similar with surrounded problem, using bfs to search. solution 123456789101112131415161718192021222324252627282930313233343536cl...