代码改变世界

阅读排行榜

[LeetCode] 系统刷题7_Array & numbers & string

2019-05-09 11:22 by Johnson_强生仔仔, 352 阅读, 收藏,
摘要: 1. 2 D Array 如果是在左上到右下的斜线的话,在同一条斜线上的x - y 相等, (x, y) 是该点的坐标 如果是在左下到右上的斜线的话,在同一条斜线上的x + y 相等, (x, y) 是该点的坐标 ex. [(1, 1), (1, 2), (1, 3)] [(2, 1), (2, 2 阅读全文

[LeetCode] questions conclusion_ Binary Search

2018-08-29 06:49 by Johnson_强生仔仔, 352 阅读, 收藏,
摘要: Binary Search T(n) = T(n/2) + O(1) => T(n) = O(lg n) proof: 如果能用iterable , 就用while loop, 可以防止用recursion的时候stack overflow( process in Linux is 8Mb), st 阅读全文

[LeetCode] 75. Sort Colors_Medium tag: Two pointers

2019-05-12 10:22 by Johnson_强生仔仔, 348 阅读, 收藏,
摘要: Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the or 阅读全文

[LeetCode] 系统刷题5_Dynamic Programming

2019-04-30 00:06 by Johnson_强生仔仔, 345 阅读, 收藏,
摘要: Dynamic Programming 实际上是[LeetCode] 系统刷题4_Binary Tree & Divide and Conquer的基础上,加上记忆化的过程。就是说,如果这个题目实际上是类似于Divide and conquer或者说是DFS,但是在计算过程中有很多重复计算同样的过程 阅读全文

[LeetCode] questions conclusion_ Dynamic Programming

2018-08-06 23:49 by Johnson_强生仔仔, 343 阅读, 收藏,
摘要: Questions: [LeetCode] 198. House Robber _Easy tag: Dynamic Programming [LeetCode] 221. Maximal Square _ Medium Tag: Dynamic Programming [LeetCode] 62. 阅读全文
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 78 下一页