面试中最常考的算法题主要是:数组、二叉树。
期中呢,HashMap、HashSet等辅助数据结构使用比较多,
“双指针法”在有序数组相关算法题中使用较多;
无序数组,使用HashMap和HashSet较多;
二叉树大多使用递归、dfs来解题。
回溯算法
https://leetcode-cn.com/problems/combination-sum/solution/hui-su-suan-fa-tao-mo-ban-ji-ke-by-jeromememory/
https://leetcode-cn.com/problems/combination-sum/solution/xue-yi-tao-zou-tian-xia-hui-su-suan-fa-by-powcai/
result = []def backtrack(路径, 选择列表):if 满足结束条件:result.add(路径)returnfor 选择 in 选择列表:做选择backtrack(路径, 选择列表)撤销选择
排序
双轴快排 https://www.jianshu.com/p/bb5e34f00ac6
https://www.jianshu.com/p/6d26d525bb96
https://www.jianshu.com/p/10aa41b780f2
https://www.cnblogs.com/strive-x/p/10302042.html
