LeetCode
LeetCode copied to clipboard
Algorithms Exercise: LeetCode Problems, LeetCode Weekly Contest etc.
以前的相关题目记录: Weekly Contest : https://github.com/caipengbo/AlgoEx/issues/2 剑指offer: https://github.com/caipengbo/Coding-Interviews/issues/33
单调栈框架 以单调递增栈为例: Next Less Element Previous Less Element ```Java for (int i = 0; i < n; i++) { right[i] = n-i; // 某些元素不能进到pop循环,所以赋初值 while (!stack.empty() && A[stack.peek()] > A[i])...
解DP的思路,先用暴力枚举,接着变成记忆化递归,接着换成自上而下的DP 分类:
Math
数学部分 - 几何问题 - 质数(素数),合数:筛选法求素数(素数表),最大公约数,最小公倍数 - 位运算 - 计算模拟 - 蓄水池抽样 - 随机
Graph
- 图的实现 - 图的常见算法 - 图的典型题目
Sort
基本的排序算法对比以及实现
双指针
几种常用的 Java 数据结构(集合) List , Set, Map都是接口,前两个继承至Collection接口,Map为独立接口 Set下有HashSet,LinkedHashSet,TreeSet List下有ArrayList,Vector,LinkedList Map下有Hashtable,LinkedHashMap,HashMap,TreeMap Collection接口下还有个Queue接口,有PriorityQueue类   **HashTable已经弃用所以不包含在内**
Tree
树
Search
# 目录 - Combination 组合 - Permutation 排列