算法入门

熟悉各种数据结构的特点和用法,学习不同算法的原理、流程、用途和效率等方面的内容。

参考:Hello 算法

image.png

  • data structure
    • data structure
    • array and linked list
      • 连续与分散存储方式
      • 两者操作方法与优缺点
      • 基于动态数组实现列表
      • 计算机内存与缓存
    • stack and queue
      • 先入后出、先入先出、双向队列
      • 基于数组和链表实现
    • hash table
      • 哈希表工作原理、基于数组实现
      • 哈希冲突、链式地址、开放寻址
      • 哈希算法的用途与设计目标
    • tree
      • 完美、完全、完满、平衡二叉树
      • 链表表示、数组表示、两者对比
      • 层序、前序、中序、后序遍历
      • 二叉搜索树
      • AVL树
    • heap
      • 小顶堆、大顶堆、优先队列
      • 基于数组实现堆、建堆操作
      • Top-k问题
    • graph
      • 有向图、连通图、有权图
      • 邻接表、邻接矩阵、两者对比
      • 广度优先遍历、深度优先遍历


  • algorithm
    • search algorithm
      • 暴力搜索:线性搜索、广度与深度优先搜索
      • 高效搜索:二分查找、哈希查找、树查找
      • 搜索算法的选取
    • sorting algorithm
      • 就地性、稳定性、自适应性、是否基于比较
      • 递归:选择排序、冒泡排序、插入排序
      • 分治:快速排序、归并排序
      • 非比较:桶排序、计数排序、基数排序
    • divide and conquer
      • 分治问题特性、解题方法
      • 例题:二分、构数组、汉诺塔
    • backtracking algorithm
      • 回溯问题特性、框架代码
      • 例题:全排列、子集和、N皇后
    • dynamic programming, DP
      • 暴力搜索、记忆化搜索、动态规划
      • 最优子结构、无后效性、子问题、无冗余性
      • 动态规划问题建模方法、求解步骤
      • 例题:0-1背包、完全背包、编辑距离
    • greedy algorithm
      • 贪心问题特性、解题方法
      • 例题:分数背包、最大客容量、最大切分乘积

刷算法题

从热门题目开刷,先积累至少 100 道题目,熟悉主流的算法问题。按照“艾宾浩斯遗忘曲线”来复习题目,通常在进行 3~5 轮的重复后,就能将其牢记在心。

清单:代码随想录力扣

搭建知识体系

在学习方面,我们可以阅读算法专栏文章、解题框架和算法教材,以不断丰富知识体系。 在刷题方面,可以尝试采用进阶刷题策略,如按专题分类、一题多解、一解多题等。

一些名词

English简体中文
algorithm算法
data structure数据结构
code代码
file文件
function函数
method方法
variable变量
asymptotic complexity analysis渐近复杂度分析
time complexity时间复杂度
space complexity空间复杂度
loop循环
iteration迭代
recursion递归
tail recursion尾递归
recursion tree递归树
big- notation 记号
asymptotic upper bound渐近上界
sign-magnitude原码
1’s complement反码
2’s complement补码
array数组
index索引
linked list链表
linked list node, list node链表节点
head node头节点
tail node尾节点
list列表
dynamic array动态数组
hard disk硬盘
random-access memory (RAM)内存
cache memory缓存
cache miss缓存未命中
cache hit rate缓存命中率
stack
top of the stack栈顶
bottom of the stack栈底
queue队列
double-ended queue双向队列
front of the queue队首
rear of the queue队尾
hash table哈希表
hash set哈希集合
bucket
hash function哈希函数
hash collision哈希冲突
load factor负载因子
separate chaining链式地址
open addressing开放寻址
linear probing线性探测
lazy deletion懒删除
binary tree二叉树
tree node树节点
left-child node左子节点
right-child node右子节点
parent node父节点
left subtree左子树
right subtree右子树
root node根节点
leaf node叶节点
edge
level
degree
height高度
depth深度
perfect binary tree完美二叉树
complete binary tree完全二叉树
full binary tree完满二叉树
balanced binary tree平衡二叉树
binary search tree二叉搜索树
AVL treeAVL 树
red-black tree红黑树
level-order traversal层序遍历
breadth-first traversal广度优先遍历
depth-first traversal深度优先遍历
binary search tree二叉搜索树
balanced binary search tree平衡二叉搜索树
balance factor平衡因子
heap
max heap大顶堆
min heap小顶堆
priority queue优先队列
heapify堆化
top- problemTop- 问题
graph
vertex顶点
undirected graph无向图
directed graph有向图
connected graph连通图
disconnected graph非连通图
weighted graph有权图
adjacency邻接
path路径
in-degree入度
out-degree出度
adjacency matrix邻接矩阵
adjacency list邻接表
breadth-first search广度优先搜索
depth-first search深度优先搜索
binary search二分查找
searching algorithm搜索算法
sorting algorithm排序算法
selection sort选择排序
bubble sort冒泡排序
insertion sort插入排序
quick sort快速排序
merge sort归并排序
heap sort堆排序
bucket sort桶排序
counting sort计数排序
radix sort基数排序
divide and conquer分治
hanota problem汉诺塔问题
backtracking algorithm回溯算法
constraint约束
solution
state状态
pruning剪枝
permutations problem全排列问题
subset-sum problem子集和问题
-queens problem 皇后问题
dynamic programming动态规划
initial state初始状态
state-transition equation状态转移方程
knapsack problem背包问题
edit distance problem编辑距离问题
greedy algorithm贪心算法