Leetcode
文章平均质量分 66
lenghuo2002
这个作者很懒,什么都没留下…
展开
-
[Leetcode] Dynamic Programming
1. Algorithm Analysis 1.1 Steps Find the state and choice for(auto state1: all possible value) { for(auto state2: all possible value) { for ... dp[state1][state2][...] = min/max(choice1, choice2...); } } Define the dp tab...原创 2021-05-28 05:46:10 · 111 阅读 · 0 评论 -
[LeetCode] Sliding Windows
1. Algorithmn Analysis Create a window [left, right) Increasing right edge to expand the window and update the matching results if window big enough, increasing left edge to shrink the window and update result Repeat step 2 and 3, until right edge reac原创 2021-05-28 05:45:29 · 127 阅读 · 0 评论 -
[LeetCode] Binary Tree Traversal
1. Binary Tree Traversal 1.1 Order types Postorder: left->right->root Preorder: root->left->right Inorder:left->root->right 1.2 Definition for a binary tree node Struct TreeNode { int val; TreeNode *left; TreeNode *rig原创 2021-01-17 14:34:43 · 145 阅读 · 0 评论