算法图解
第一章 算法简介
二分法
def binary_search(array, target):
low = 0
high = len(array)-1
while low < high:
mid = (low+high) >> 1
if target > array[mid]:
low = mid+1
else:
high = mid
return high第二章 选择排序
def findSmallestIndex(array):
smallest = array[0]
smallestIndex = 0
for i in range(1, len(array)):
if array[i] < smallest:
smallest = array[i]
smallestIndex = i
return smallestIndex
def selectionSort(arr):
newArr = []
for _ in arr:
smallest = findSmallestIndex(arr)
newArr.append(arr.pop(smallest))
return newArr第三章 递归
第四章 快速排序
快排

第五章 散列表/哈希表
散列函数
冲突
填装因子
第六章 广度优先搜索
第七章 狄克斯特拉算法

第八章 贪婪算法
近似算法

np完全问题
旅行商问题
集合覆盖问题
np完全问题特点
第九章 动态规划
背包问题



最长公共子串

第十章 k最近算法
十一章 10种算法
树
反向索引
傅立叶变换
并行算法
mapreduce
map映射
reduce归并
概率型数据结构和算法
布隆过滤器
hyperLogLog
SHA
局部敏感/不敏感
非对称加密Diffie-Hellman
线性规划
Last updated
Was this helpful?