leedcode算法
1.LeetCode - 合并两个链表
2.
3. 链表是否有环 https://jingyan.baidu.com/article/066074d69afb8d83c31cb068.html
a, hashset contins 判断
b. 快慢指针
4. 2个链表是相交
5,字符出现的次数
- public static char FindMapMaxValue(Map<Character, Integer> map) {
- Iterator iter = map.entrySet().iterator();
- Map.Entry entry = (Map.Entry) iter.next();// 将第一个entry定义为最大次数的
- char maxKey = (char) entry.getKey();// 获得K
- int maxValue = (int) entry.getValue();// 获得V
- while (iter.hasNext()) {
- entry = (Map.Entry) iter.next();// 第二个entry
- char tempK = (char) entry.getKey();
- int tempV = (int) entry.getValue();
- if (maxValue < tempV) {
- maxKey = tempK;
- maxValue = tempV;
- }
- }
- System.out.println("出现次数最多的字符:" + maxKey + " 出现次数:" + maxValue);
- return maxKey;
求树的深度
我只是偶尔安静下来,对过去的种种思忖一番。那些曾经的旧时光里即便有过天真愚钝,也不值得谴责。毕竟,往后的日子,还很长。不断鼓励自己,
天一亮,又是崭新的起点,又是未知的征程(上校9)
逆水行舟,不进,则退!