diff --git a/notes/Java 并发.md b/notes/Java 并发.md index fb5c1ca6..0191bc53 100644 --- a/notes/Java 并发.md +++ b/notes/Java 并发.md @@ -922,8 +922,8 @@ public static String concatString(String s1, String s2, String s3) { # 参考资料 -- Java 编程思想 -- 深入理解 Java 虚拟机 +- BruceEckel. Java 编程思想: 第 4 版 [M]. 机械工业出版社, 2007. +- 周志明. 深入理解 Java 虚拟机 [M]. 机械工业出版社, 2011. - [线程通信](http://ifeve.com/thread-signaling/#missed_signal) - [Java 线程面试题 Top 50](http://www.importnew.com/12773.html) - [BlockingQueue](http://tutorials.jenkov.com/java-util-concurrent/blockingqueue.html) diff --git a/notes/Java 虚拟机.md b/notes/Java 虚拟机.md index 7a844790..5f5f8bf7 100644 --- a/notes/Java 虚拟机.md +++ b/notes/Java 虚拟机.md @@ -681,6 +681,6 @@ java -Xmx12m -Xms3m -Xmn1m -XX:PermSize=20m -XX:MaxPermSize=20m -XX:+UseSerialGC # 参考资料 -- 深入理解 Java 虚拟机 +- 周志明. 深入理解 Java 虚拟机 [M]. 机械工业出版社, 2011. - [Jvm memory](https://www.slideshare.net/benewu/jvm-memory) - [Memory Architecture Of JVM(Runtime Data Areas)](https://hackthejava.wordpress.com/2015/01/09/memory-architecture-by-jvmruntime-data-areas/) diff --git a/notes/Leetcode 题解.md b/notes/Leetcode 题解.md index 137e54b0..6be5727b 100644 --- a/notes/Leetcode 题解.md +++ b/notes/Leetcode 题解.md @@ -2423,6 +2423,12 @@ public int numberOfArithmeticSlices(int[] A) { [Leetcode : 583. Delete Operation for Two Strings (Medium)](https://leetcode.com/problems/delete-operation-for-two-strings/description/) +```html +Input: "sea", "eat" +Output: 2 +Explanation: You need one step to make "sea" to "ea" and another step to make "eat" to "ea". +``` + 可以转换为求两个字符串的最长公共子序列问题。 ```java @@ -2432,8 +2438,8 @@ public int minDistance(String word1, String word2) { for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { if (i == 0 || j == 0) continue; - dp[i][j] = word1.charAt(i - 1) == word2.charAt(j - 1) ? dp[i - 1][j - 1] + 1 - : Math.max(dp[i][j - 1], dp[i - 1][j]); + dp[i][j] = word1.charAt(i - 1) == word2.charAt(j - 1) ? + dp[i - 1][j - 1] + 1 : Math.max(dp[i][j - 1], dp[i - 1][j]); } } return m + n - 2 * dp[m][n]; @@ -2610,26 +2616,16 @@ public int maxProfit(int[] prices) { } ``` -**统计从 0 \~ n 每个数的二进制表示中 1 的个数** - -[Leetcode : 338. Counting Bits (Medium)](https://leetcode.com/problems/counting-bits/description/) - -对于数字 6(110),它可以看成是数字 2(10) 前面加上一个 1 ,因此 dp[i] = dp[i&(i-1)] + 1; - -```java - public int[] countBits(int num) { - int[] ret = new int[num + 1]; - for(int i = 1; i <= num; i++){ - ret[i] = ret[i&(i-1)] + 1; - } - return ret; - } -``` - **一组整数对能够构成的最长链** [Leetcode : 646. Maximum Length of Pair Chain (Medium)](https://leetcode.com/problems/maximum-length-of-pair-chain/description/) +```html +Input: [[1,2], [2,3], [3,4]] +Output: 2 +Explanation: The longest chain is [1,2] -> [3,4] +``` + 对于 (a, b) 和 (c, d) ,如果 b < c,则它们可以构成一条链。 ```java @@ -3092,6 +3088,22 @@ public int[] productExceptSelf(int[] nums) { } ``` +**统计从 0 \~ n 每个数的二进制表示中 1 的个数** + +[Leetcode : 338. Counting Bits (Medium)](https://leetcode.com/problems/counting-bits/description/) + +对于数字 6(110),它可以看成是数字 (10) 前面加上一个 1 ,因此 dp[i] = dp[i&(i-1)] + 1; + +```java +public int[] countBits(int num) { + int[] ret = new int[num + 1]; + for(int i = 1; i <= num; i++){ + ret[i] = ret[i&(i-1)] + 1; + } + return ret; +} +``` + # 数据结构相关 ## 栈和队列 diff --git a/notes/MySQL.md b/notes/MySQL.md index 87b4c233..3588d9f9 100644 --- a/notes/MySQL.md +++ b/notes/MySQL.md @@ -386,7 +386,7 @@ do { # 参考资料 -- 高性能 MySQL +- BaronScbwartz, PeterZaitsev, VadimTkacbenko, 等. 高性能 MySQL[M]. 电子工业出版社, 2013. - [How Sharding Works](https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6) - [MySQL 索引背后的数据结构及算法原理 ](http://blog.codinglabs.org/articles/theory-of-mysql-index.html) - [20+ 条 MySQL 性能优化的最佳经验 ](https://www.jfox.info/20-tiao-mysql-xing-nen-you-hua-de-zui-jia-jing-yan.html) diff --git a/notes/Redis.md b/notes/Redis.md index 8d61c65f..20de47e0 100644 --- a/notes/Redis.md +++ b/notes/Redis.md @@ -452,8 +452,8 @@ Redis 没有关系型数据库中的表这一概念来将同类型的数据存 # 参考资料 -- Redis 实战 -- Reids 设计与实现 +- Carlson J L. Redis in Action[J]. Media.johnwiley.com.au, 2013. +- 黄健宏. Redis 设计与实现 [M]. 机械工业出版社, 2014. - [REDIS IN ACTION](https://redislabs.com/ebook/foreword/) - [论述 Redis 和 Memcached 的差异](http://www.cnblogs.com/loveincode/p/7411911.html) - [Redis 3.0 中文版- 分片](http://wiki.jikexueyuan.com/project/redis-guide) diff --git a/notes/SQL.md b/notes/SQL.md index 7f8c877d..729005b4 100644 --- a/notes/SQL.md +++ b/notes/SQL.md @@ -22,6 +22,7 @@ * [二十一、事务处理](#二十一事务处理) * [二十二、字符集](#二十二字符集) * [二十三、权限管理](#二十三权限管理) +* [参考资料](#参考资料) @@ -730,3 +731,6 @@ GRANT 和 REVOKE 可在几个层次上控制访问权限: SET PASSWROD FOR myuser = Password('newpassword'); ``` +# 参考资料 + +- BenForta. SQL 必知必会 [M]. 人民邮电出版社, 2013. diff --git a/notes/代码可读性.md b/notes/代码可读性.md index 5d40b41b..744b8bab 100644 --- a/notes/代码可读性.md +++ b/notes/代码可读性.md @@ -12,6 +12,7 @@ * [十一、一次只做一件事](#十一一次只做一件事) * [十二、用自然语言表述代码](#十二用自然语言表述代码) * [十三、减少代码量](#十三减少代码量) +* [参考资料](#参考资料) @@ -340,3 +341,7 @@ public int findClostElement(int[] arr) { 不要过度设计,编码过程会有很多变化,过度设计的内容到最后往往是无用的。 多用标准库实现。 + +# 参考资料 + +- Dustin, Boswell, Trevor, 等. 编写可读代码的艺术 [M]. 机械工业出版社, 2012. diff --git a/notes/正则表达式.md b/notes/正则表达式.md index 00e9d555..d890273b 100644 --- a/notes/正则表达式.md +++ b/notes/正则表达式.md @@ -9,6 +9,7 @@ * [八、回溯引用](#八回溯引用) * [九、前后查找](#九前后查找) * [十、嵌入条件](#十嵌入条件) +* [参考资料](#参考资料) @@ -378,3 +379,7 @@ aBCd 1. **11111** 2. 22222- 3. **33333-4444** + +# 参考资料 + +- BenForta. 正则表达式必知必会 [M]. 人民邮电出版社, 2007. diff --git a/notes/计算机网络.md b/notes/计算机网络.md index 9c74c7e9..a6728930 100644 --- a/notes/计算机网络.md +++ b/notes/计算机网络.md @@ -883,5 +883,5 @@ P2P 是一个分布式系统,任何时候都有对等方加入或者退出。 # 参考资料 -- 计算机网络 第七版 -- 计算机网络 自顶向下方法 +- 计算机网络, 谢希仁 +- JamesF.Kurose, KeithW.Ross, 库罗斯, 等. 计算机网络: 自顶向下方法 [M]. 机械工业出版社, 2014. diff --git a/notes/设计模式.md b/notes/设计模式.md index 35ba2440..59659653 100644 --- a/notes/设计模式.md +++ b/notes/设计模式.md @@ -18,6 +18,7 @@ * [十五、代理模式](#十五代理模式) * [十六、MVC](#十六mvc) * [十七、与设计模式相处](#十七与设计模式相处) +* [参考资料](#参考资料) @@ -1798,3 +1799,7 @@ No gumball dispensed ## 模式分类