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;
求树的深度