Skip to content

Commit fa597b0

Browse files
author
robot
committed
feat: english version thinkings
1 parent ce3495d commit fa597b0

26 files changed

+242
-2353
lines changed

Diff for: README.en.md

+27-17
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# LeetCode
22

3-
[![Travis](https://img.shields.io/badge/language-C++-green.svg)]()
4-
[![Travis](https://img.shields.io/badge/language-JavaScript-yellow.svg)]()
5-
[![Travis](https://img.shields.io/badge/language-Python-red.svg)]()
6-
[![Travis](https://img.shields.io/badge/language-Java-blue.svg)]()
7-
![Total visitor](https://visitor-count-badge.herokuapp.com/total.svg?repo_id=azl397985856.leetcode.en)
8-
![Visitors in today](https://visitor-count-badge.herokuapp.com/today.svg?repo_id=azl397985856.leetcode.en)
3+
[![Travis](https://img.shields.io/badge/language-C++-green.svg)]() [![Travis](https://img.shields.io/badge/language-JavaScript-yellow.svg)]() [![Travis](https://img.shields.io/badge/language-Python-red.svg)]() [![Travis](https://img.shields.io/badge/language-Java-blue.svg)]() ![Total visitor](https://visitor-count-badge.herokuapp.com/total.svg?repo_id=azl397985856.leetcode.en) ![Visitors in today](https://visitor-count-badge.herokuapp.com/today.svg?repo_id=azl397985856.leetcode.en)
94

105
> since 2019-09-03 19:40
116
@@ -15,8 +10,7 @@
1510

1611
![leetcode.jpeg](https://tva1.sinaimg.cn/large/007S8ZIlly1ghltwf4xivj30dw0780sm.jpg)
1712

18-
This essay records the course of and my emotion to this project from initialization to 10,000 stars.
19-
[Milestone for 10,000+ stars](./thanksGiving.md)
13+
This essay records the course of and my emotion to this project from initialization to 10,000 stars. [Milestone for 10,000+ stars](./thanksGiving.md)
2014

2115
If you are interested in this project, **do not mean your star**. This project will be **supported for a long enough time** by the community. Thanks for every audience and contributor.
2216

@@ -96,7 +90,7 @@ The data structures mainly include:
9690

9791
> Here only lists some **representative problems** but not all.
9892
99-
#### Easy
93+
#### Easy
10094

10195
- [Easy Collection](https://github.com/azl397985856/leetcode/blob/master/collections/easy.en.md)
10296

@@ -125,15 +119,31 @@ The data structures mainly include:
125119

126120
### Summary of Data Structures and Algorithm
127121

128-
- [Data Structure](./thinkings/basic-data-structure-en.md)
129-
- [Basic Algorithm](./thinkings/basic-algorithm-en.md)
122+
- [Basic data structure (overview)](./thinkings/basic-data-structure.en.md)
123+
- [I have almost finished brushing all the linked topics of Lixu, and I found these things. 。 。](./thinkings/linked-list.en.md)
124+
- [I have almost finished brushing all the tree questions of Lixu, and I found these things. 。 。](./thinkings/tree.en.md)
125+
- [堆专题(上)](./thinkings/heap.en.md) (WIP)
126+
- [I have almost finished brushing all the piles of questions, and I found these things. 。 。 (Second bullet)](./thinkings/heap-2.en.md)
127+
- [I have almost finished brushing all the two-point questions of Lixiu, and I found these things. 。 。 (Part 1)](./thinkings/binary-search-1.en.md)
128+
- [I have almost finished brushing all the two-point questions of Lixiu, and I found these things. 。 。 (Part 2)](./thinkings/binary-search-2.en.md)
129+
130+
<!-- - [基础算法](./thinkings/basic-algorithm.md) -->
131+
132+
- [Dynamic Programming](./thinkings/dynamic-programming.en.md)
133+
- [Search Problems](./thinkings/search.en.md)
130134
- [Binary Tree Traversal](./thinkings/binary-tree-traversal.en.md)
131-
- [Dynamic Programming](./thinkings/dynamic-programming-en.md)
132-
- [Huffman Encode and Run Length Encode](./thinkings/run-length-encode-and-huffman-encode-en.md)
133-
- [Bloom Filter](./thinkings/bloom-filter-en.md)
134-
- [String Problems](./thinkings/string-problems-en.md)
135-
- [Sliding Window Technique](./thinkings/slide-window.en.md)
136-
- [Trie](./thinkings/trie.en.md)
135+
- [Backtracking](./thinkings/backtrack.en.md)
136+
- [Run code and Huffman code](./thinkings/run-length-encode-and-huffman-encode.en.md)
137+
- [Bloom filter](./thinkings/bloom-filter.en.md)🖊
138+
- [Trie](./thinkings/trie.en.md)🖊
139+
- [滑动窗口(思路 + 模板)](./thinkings/slide-window.en.md) (WIP)
140+
- [Bit Operation](./thinkings/bit.en.md)
141+
- [Kojima Question](./thinkings/island.en.md)🖊
142+
- [GCD Problems](./thinkings/GCD.en.md)
143+
- [Union Find (Disjoint Set) Problem](./thinkings/union-find.en.md)
144+
- [Balanced Binary Tree](./thinkings/balanced-tree.en.md)
145+
- [Reservoir Sampling](./thinkings/reservoid-sampling.en.md)
146+
- [Monotonic stack](./thinkings/monotone-stack.en.md)
137147

138148
### Anki Flashcards
139149

Diff for: thinkings/balanced-tree.en.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Balanced Binary Tree Topic
1+
# Balanced Binary Tree
22

33
There are still some topics related to balancing binary trees, and they are all very classic. It is recommended that everyone practice. Today, I have selected 4 questions for everyone. If you thoroughly understand these questions, you should not be out of ideas when you encounter other balanced binary tree questions. After you understand my thoughts, it is recommended to find a few more topics to practice your hands and consolidate your learning results.
44

@@ -86,8 +86,7 @@ return self. isBalanced(root. left) and self. isBalanced(root. right)
8686

8787
**Complexity analysis**
8888

89-
- Time complexity: for isBalanced to say, since each node has at most be accessed once, this part of the time complexity is $O(N)$, while the dfs function each time it is call the number of not more than $log N$, so the total time complexity is $O(NlogN)$, where $N$ is a tree of nodes total.
90-
-Spatial complexity: Due to the use of recursion, the bottleneck of spatial complexity here is in the stack space, so the spatial complexity is $O(h)$, where $H$ is the height of the tree.
89+
- Time complexity: for isBalanced to say, since each node has at most be accessed once, this part of the time complexity is $O(N)$, while the dfs function each time it is call the number of not more than $log N$, so the total time complexity is $O(NlogN)$, where $N$ is a tree of nodes total. -Spatial complexity: Due to the use of recursion, the bottleneck of spatial complexity here is in the stack space, so the spatial complexity is $O(h)$, where $H$ is the height of the tree.
9190

9291
## 108. Convert an ordered array to a binary search tree (simple)
9392

@@ -148,8 +147,7 @@ return root
148147

149148
**Complexity analysis**
150149

151-
-Time complexity: Since each node is accessed at most once, the total time complexity is $O(N)$, where $N$ is the length of the array.
152-
-Spatial complexity: Due to the use of recursion, the bottleneck of spatial complexity here is in the stack space, so the spatial complexity is $O(h)$, where $H$ is the height of the tree. At the same time, because it is a balanced binary tree, $h$ is 就是 log N$.
150+
-Time complexity: Since each node is accessed at most once, the total time complexity is $O(N)$, where $N$ is the length of the array. -Spatial complexity: Due to the use of recursion, the bottleneck of spatial complexity here is in the stack space, so the spatial complexity is $O(h)$, where $H$ is the height of the tree. At the same time, because it is a balanced binary tree, $h$ is 就是 log N$.
153151

154152
## 109. Ordered linked list conversion binary search tree (medium)
155153

@@ -184,8 +182,7 @@ The same idea as 108. The difference is the different data structures, so we nee
184182

185183
Let's take a look at the linked list again:
186184

187-
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghluhpjgtqj31q30u0mzv.jpg)
188-
(The case of the linked list)
185+
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghluhpjgtqj31q30u0mzv.jpg) (The case of the linked list)
189186

190187
To find the midpoint, you only need to use the classic speed pointer. At the same time, in order to prevent the ring from appearing, we need to cut off the next pointer to mid, so we need to record a node before the midpoint. This only needs to be recorded with a variable pre.
191188

@@ -296,8 +293,7 @@ return root;
296293
297294
Let n be the length of the linked list.
298295
299-
- Time complexity: the recursion tree of depth $logn$, each layer of the basic operation of the number of $n$, so the total time complexity is$O(nlogn)$
300-
-Spatial complexity: The spatial complexity is$O(logn)$
296+
- Time complexity: the recursion tree of depth $logn$, each layer of the basic operation of the number of $n$, so the total time complexity is$O(nlogn)$ -Spatial complexity: The spatial complexity is$O(logn)$
301297
302298
Some students are not very good at analyzing the time complexity and space complexity of recursion. We will introduce it to you again here.
303299
@@ -309,8 +305,7 @@ The time complexity is a little bit more difficult. Before, Sifa told everyone i
309305
310306
However, we found that the basic operands of each layer of the recursive tree are fixed, and the number of fixed operations has been calculated for everyone on the graph. Therefore, the total spatial complexity can actually be calculated by the \*\* recursion depth\* The basic operands of each layer, which is $nlogn$. Similar techniques can be used in the complexity analysis of merge sorting.
311307
312-
In addition, everyone can directly derive it from the formula. For this question, set the basic operand T(n), then there is T(n)= T(n/2)\*2+ n/2, and it is deduced that T(n) is probably nlogn. This should be high school knowledge.
313-
The specific derivation process is as follows:
308+
In addition, everyone can directly derive it from the formula. For this question, set the basic operand T(n), then there is T(n)= T(n/2)\*2+ n/2, and it is deduced that T(n) is probably nlogn. This should be high school knowledge. The specific derivation process is as follows:
314309
315310
$$
316311

Diff for: thinkings/basic-algorithm-en.en.md

-61
This file was deleted.

Diff for: thinkings/basic-algorithm-en.md

-61
This file was deleted.

Diff for: thinkings/basic-algorithm.en.md

+33-31
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,61 @@
1-
# 基础算法
1+
# Basic Algorithms
22

3-
## 时间复杂度分析
3+
## Analysis of Time Complexity
44

5-
## 算法思想
5+
## Algorithm Thoughts
66

7-
### 贪心算法
7+
### Greedy Algorithms
88

9-
### 分治
9+
### Divide-and-Conquer
1010

11-
### 动态规划
11+
### Dynamic Programming
1212

13-
### 回溯法
13+
### Backtracking
1414

15-
### 枚举法
15+
### Enumeration
1616

17-
## 元算法
17+
## Meta Algorithm
18+
19+
### Sorting Algorithms
20+
21+
Sorting algorithms are meta algorithm. Although they are not tested quit often, the core ideas are very useful.
1822

19-
### 排序算法
20-
排序算法是一种元算法,直接考的很少,但是思想还是有用的。
2123
#### O(n^2)
2224

23-
- 插入排序
24-
- 选择排序
25-
- 希尔排序
26-
- 冒泡排序
25+
- Insertion Sort
26+
- Selection Sort
27+
- Shell's Sort (aka Diminishing Increment Sort)
28+
- Bubble Sort
2729

2830
#### O(nlogn)
2931

30-
- 快排
31-
- 归并排序
32-
- 堆排序
32+
- Quick Sort
33+
- Merge Sort
34+
- Heap Sort
3335

3436
#### O(n)
3537

36-
- 桶排序
37-
- 计数排序
38-
- 基数排序
38+
- Bucket Sort
39+
- Counting Sort
40+
- Radix Sort
3941

40-
### 查找算法
42+
### Searching Algorithm
4143

42-
- 线性查找
43-
- 树查找
44-
- 散列表查找
44+
- BFPRT Algorithm
45+
- Search Trees
46+
- Search by Hashing
4547

46-
## 字符串问题
48+
## Algorithms for String
4749

4850
- 朴素
4951
- KMP
5052
- RK
5153
- BM
5254
- trie
5355

54-
## 其他
56+
## Other
5557

56-
- 数论
57-
- 概率论
58-
- 并查集
59-
- 矩阵运算
58+
- Number Theory
59+
- Probability Theory
60+
- Union-find Algorithm
61+
- Matrix Algorithms

0 commit comments

Comments
 (0)