Algorithm and Data Structure Notes
Introduction
Binary Search
Search in a Big Sorted Array
Rotated Sorted Array
Find Peak Number
Search 2D matrix
Reduce size by half every time
Intersection of Two Arrays
User `Arrays.binarySearch()`
Binary Tree
Level Order Traverse
Path/Path Sum in the Tree
Depth/Balanced Binary Tree
Height of Tree
修改结构
Binary Tree Vertical Order Traversal
LCA
Binary Tree Serialization
子树结构
BST
unique Binary Search Tree
TreeSet/Use BST to improve the search/insert/delete
Range Search
BFS
Graph Valid Tree
Clone Graph
Topological Sorting
Number of Islands
Word Ladder
Walls and Gates
DFS
backtracking
N Queens
word search
Letter Combinations of A Phone Nubmer
Matrix
Rotate
Array
subarray
Majority Element/Frequency
Iterator
数组环形跳转
LinkedList
LinkedList Cycle
Double LinkedList
Merge
Two Pointers
Two Sum
窗口型
Partition
Sorting
HashMap/HashSet
增强HashMap
HashMap计算频率类型
TreeMap
Dynamic Programming
DP - from any point
DP - Two Sequence
DP - String
frog jump
DP - Backpack
Coin Change
Word break
House Robber
划分型DP
区间型DP
记忆化搜索
String 类
String prefix类
repeated String
括号类型
Mirror Symmetric
Math
Integer
bits
Java
Trie
Heap
find Kth largest/smallest
HashHeap
Union Find
Minimum Cost Spanning Tree
Union Find 的应用
Data Structure
Stack
stack的应用
Design
Tiny Url
Queue
Deque
Greedy
Powered by
GitBook
DP - Backpack
Backpack
n个整数a[1...n],装m的背包
state: 前i个数,能否组成和为j
function: dp[i][j] = dp[i-1][j] or dp[i-1][j-a[i]]
initialize: dp[x][0] = true; dp[0][j] = false;
answer:
results matching "
"
No results matching "
"