算法是很重要的,我一直忽略,但是确实是很重要的东西,这是进入大厂的钥匙,也是提高自己代码能力的钥匙。
我的学习路线如下:
目录
- 算法复杂度分析:Complexity
- 前缀和: Prefix-Sum
- 数组和字符串: Arrays-and-Strings
- 排序算法: Sorting-Algorithms
- 二分查找: Binary-Search
- 滑动窗口和双指针: Sliding-Window-and-Two-Pointers
- 递归和分治: Recursion-and-Divide-and-Conquer
- 位运算和数学: Bit-Manipulation-and-Mathematics
- 哈希表: Hash-Table
- 链表: Linked-List
- 普通树: Tree
- 队列与栈: Queues-and-Stacks
- 算法面试小抄: Algorithm-Interview-Cheat-Sheet
- 深度优先搜索: Depth-First-Search-(DFS)
- 图: Graph
- 堆: Heap
- 广度优先搜索: Breadth-First-Search-(BFS)
- 贪心算法: Greedy-Algorithm
- 线性&区间问题: Linear-Interval-Problems
- 动态规划基础模型: Dynamic-Programming
- 状压、计数& 数位问题: Bitmasking-Counting-Digit-Problems
- 树形、图上、概率&博弈问题: Tree-based-Graph-based-Probability-Game-Theory-Problems
一些脚本
首先使用脚本在当前文件夹下的所有文件夹都创建我练习算法的文件夹,命令如下:
mkdir Prefix-Sum Arrays-and-Strings Sorting-Algorithms Binary-Search Sliding-Window-and-Two-Pointers Recursion-and-Divide-and-Conquer Bit-Manipulation-and-Mathematics Hash-Table Linked-List Tree Que
ues-and-Stacks Algorithm-Interview-Cheat-Sheet Depth-First-Search-$DFS$ Graph Heap Breadth-First-Search-$BFS$ Greedy-Algorithm Linear-Interval-Problems Dynamic-Programming Bitmasking-Counting-Digit-Pro
blems Tree-based-Graph-based-Probability-Game-Theory-Problems
然后我需要在每个文件夹里创建 README.md 文件,用于讲解这个算法大概是个什么东西。命令如下:
find . -type d -maxdepth 1 -mindepth 1 -exec touch {}/README.md \;
然后我需要将每个算法的标题附着到 README.md 中的开头去,命令如下:
find . -type d -maxdepth 1 -mindepth 1 -exec sh -c 'dir=$(basename "$0"); dir_with_spaces=$(echo "$dir" | tr "-" " "); echo "# $dir_with_spaces" > "$0/README.md"' {} \;
做完这些就结束了暂时~~~