代码改变世界

阅读排行榜

【剑指Offer学习】【面试题3 :二维数组中的查找】

2022-11-13 22:17 by tonyniu8, 28 阅读, 收藏,
摘要: 思路: 规律从右上角开始,或左下开始。 不能从左上角开始找,这样每次比较后向右和向下都是越来越大。 public class P03_FindMaxInMatrix { /* 规律从右上角开始: 如果该数字小于目标,向下row ++; 如果该数字大于目标,向左col --; 直到要找到的数字,或者查 阅读全文

text edit,

2022-10-04 21:15 by tonyniu8, 28 阅读, 收藏,
摘要: [TOC] # top Values under 1.0 indicate that the machine is not busy. /proc/cpuinfo # sort cat -e test.sh print no display word -n display blank line so 阅读全文

297. Serialize and Deserialize Binary Tree

2022-04-09 21:56 by tonyniu8, 26 阅读, 收藏,
摘要: https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/solution/shou-hui-tu-jie-gei-chu-dfshe-bfsliang-chong-jie-f/ 阅读全文

单例模式

2023-08-13 22:06 by tonyniu8, 25 阅读, 收藏,
摘要: # 双重锁 ## 解释 * 双重if是需要的。 如果只有一重,还是可能初始化两次 * valatile是要得。 `uniqueInstance = new Singleton();` 这段代码其实是分为三步执行: 1. 为 uniqueInstance 分配内存空间 2. 初始化 uniqueIns 阅读全文

java SE 八股2

2023-03-11 21:10 by tonyniu8, 25 阅读, 收藏,
摘要: 1.hashmap hashmap不是线程安全,若要线程安全使用concurrenthashmap.hashtable是为了和老代码兼容。 (1) HashMap:它根据键的hashCode值存储数据,大多数情况下可以直接定位到它的值,因而具有很快的访问速度,但遍历顺序却是不确定的。 HashMap 阅读全文
上一页 1 ··· 5 6 7 8 9 10 下一页