Skip to content

Commit b6664fe

Browse files
committed
add 137 190 201 295 502
1 parent 4dd045e commit b6664fe

33 files changed

+861
-367
lines changed

assets/output/0137.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

assets/output/0190.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

assets/output/0201.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

assets/output/0295.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

assets/output/0502.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/.vuepress/sidebar.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export default sidebar({
177177
"0134",
178178
"0135",
179179
"0136",
180+
"0137",
180181
"0138",
181182
"0139",
182183
"0141",
@@ -202,6 +203,7 @@ export default sidebar({
202203
"0174",
203204
"0188",
204205
"0189",
206+
"0190",
205207
"0191",
206208
"0198",
207209
"0199"
@@ -212,6 +214,7 @@ export default sidebar({
212214
collapsible: true,
213215
children: [
214216
"0200",
217+
"0201",
215218
"0202",
216219
"0203",
217220
"0205",
@@ -252,6 +255,7 @@ export default sidebar({
252255
"0283",
253256
"0289",
254257
"0290",
258+
"0295",
255259
"0297"
256260
],
257261
},
@@ -313,6 +317,7 @@ export default sidebar({
313317
text: "0500-0599",
314318
collapsible: true,
315319
children: [
320+
"0502",
316321
"0503",
317322
"0506",
318323
"0509",

src/leetcode/algorithm/binary_search.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
二分查找(Binary Search)算法,也叫折半查找算法。二分查找针对的是一个有序的数据集合,查找思想有点类似分治思想。每次都通过跟区间的中间元素对比,将待查找的区间缩小为之前的一半,直到找到要查找的元素,或者区间被缩小为 0。
44

5-
二分查找是一种非常高效的查找算法,时间复杂度是 O(logn)
5+
二分查找是一种非常高效的查找算法,时间复杂度是 `O(log n)`
66

77
## 循环实现
88

9-
最简单的情况就是**有序数组****不存在重复元素**我们在其中用二分查找值等于给定值的数据。
9+
最简单的情况就是**有序数组****不存在重复元素**,我们在其中用二分查找值等于给定值的数据。
1010

1111
```javascript
1212
// 二分查找的循环实现
@@ -67,7 +67,7 @@ function bsearchInternally(arr, low, high, value) {
6767

6868
## 应用场景的局限性
6969

70-
二分查找的时间复杂度是 O(logn),查找数据的效率非常高。不过,并不是什么情况下都可以用二分查找,它的应用场景是有很大局限性的。
70+
二分查找的时间复杂度是 `O(log n)`,查找数据的效率非常高。不过,并不是什么情况下都可以用二分查找,它的应用场景是有很大局限性的。
7171

7272
### 依赖顺序表结构(数组)
7373

src/leetcode/algorithm/bit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
| :------: | :------ | :------: | :------ | :------ |
1212
| 0504 | [七进制数](https://leetcode.com/problems/base-7/) | | [`数学`](/leetcode/outline/tag/mathematics.md) | <font color=#15bd66>Easy</font> |
1313
| 0405 | [数字转换为十六进制数](https://leetcode.com/problems/convert-a-number-to-hexadecimal/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数学`](/leetcode/outline/tag/mathematics.md) | <font color=#15bd66>Easy</font> |
14-
| 0190 | [颠倒二进制位](https://leetcode.com/problems/reverse-bits/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`分治`](/leetcode/outline/tag/divide-and-conquer.md) | <font color=#15bd66>Easy</font> |
14+
| 0190 | [颠倒二进制位](https://leetcode.com/problems/reverse-bits/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0190) | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`分治`](/leetcode/outline/tag/divide-and-conquer.md) | <font color=#15bd66>Easy</font> |
1515
| 1009 | [十进制整数的反码](https://leetcode.com/problems/complement-of-base-10-integer/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) | <font color=#15bd66>Easy</font> |
1616
| 0191 | [位1的个数](https://leetcode.com/problems/number-of-1-bits/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0191) | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`分治`](/leetcode/outline/tag/divide-and-conquer.md) | <font color=#15bd66>Easy</font> |
1717
| 0371 | [两整数之和](https://leetcode.com/problems/sum-of-two-integers/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数学`](/leetcode/outline/tag/mathematics.md) | <font color=#ffb800>Medium</font> |
1818
| 0089 | [格雷编码](https://leetcode.com/problems/gray-code/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数学`](/leetcode/outline/tag/mathematics.md) [`回溯`](/leetcode/outline/tag/backtracking.md) | <font color=#ffb800>Medium</font> |
19-
| 0201 | [数字范围按位与](https://leetcode.com/problems/bitwise-and-of-numbers-range/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) | <font color=#ffb800>Medium</font> |
19+
| 0201 | [数字范围按位与](https://leetcode.com/problems/bitwise-and-of-numbers-range/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0201) | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) | <font color=#ffb800>Medium</font> |
2020
| 0338 | [比特位计数](https://leetcode.com/problems/counting-bits/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`动态规划`](/leetcode/outline/tag/dynamic-programming.md) | <font color=#15bd66>Easy</font> |
2121
| 0136 | [只出现一次的数字](https://leetcode.com/problems/single-number/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0136) | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数组`](/leetcode/outline/tag/array.md) | <font color=#15bd66>Easy</font> |
22-
| 0137 | [只出现一次的数字 II](https://leetcode.com/problems/single-number-ii/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数组`](/leetcode/outline/tag/array.md) | <font color=#ffb800>Medium</font> |
22+
| 0137 | [只出现一次的数字 II](https://leetcode.com/problems/single-number-ii/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0137) | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数组`](/leetcode/outline/tag/array.md) | <font color=#ffb800>Medium</font> |
2323
| 0260 | [只出现一次的数字 III](https://leetcode.com/problems/single-number-iii/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数组`](/leetcode/outline/tag/array.md) | <font color=#ffb800>Medium</font> |
2424
| 0268 | [丢失的数字](https://leetcode.com/problems/missing-number/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0268) | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数组`](/leetcode/outline/tag/array.md) [`哈希表`](/leetcode/outline/tag/hash-table.md) `3+` | <font color=#15bd66>Easy</font> |
2525
| 1349 | [参加考试的最大学生数](https://leetcode.com/problems/maximum-students-taking-exam/) | | [`位运算`](/leetcode/outline/tag/bit-manipulation.md) [`数组`](/leetcode/outline/tag/array.md) [`动态规划`](/leetcode/outline/tag/dynamic-programming.md) `2+` | <font color=#ff334b>Hard</font> |

src/leetcode/ds/queue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ console.log(priorityQueue.count()); // output: 3
734734
| 0973 | [最接近原点的 K 个点](https://leetcode.com/problems/k-closest-points-to-origin/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0973) | [`几何`](/leetcode/outline/tag/geometry.md) [`数组`](/leetcode/outline/tag/array.md) [`数学`](/leetcode/outline/tag/mathematics.md) `4+` | <font color=#ffb800>Medium</font> |
735735
| 1296 | [划分数组为连续数字的集合](https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/) | | [`贪心`](/leetcode/outline/tag/greedy.md) [`数组`](/leetcode/outline/tag/array.md) [`哈希表`](/leetcode/outline/tag/hash-table.md) `1+` | <font color=#ffb800>Medium</font> |
736736
| 0239 | [滑动窗口最大值](https://leetcode.com/problems/sliding-window-maximum/) | | [`队列`](/leetcode/outline/tag/queue.md) [`数组`](/leetcode/outline/tag/array.md) [`滑动窗口`](/leetcode/outline/tag/sliding-window.md) `2+` | <font color=#ff334b>Hard</font> |
737-
| 0295 | [数据流的中位数](https://leetcode.com/problems/find-median-from-data-stream/) | | [`设计`](/leetcode/outline/tag/design.md) [`双指针`](/leetcode/outline/tag/two-pointers.md) [`数据流`](/leetcode/outline/tag/data-streams.md) `2+` | <font color=#ff334b>Hard</font> |
737+
| 0295 | [数据流的中位数](https://leetcode.com/problems/find-median-from-data-stream/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0295) | [`设计`](/leetcode/outline/tag/design.md) [`双指针`](/leetcode/outline/tag/two-pointers.md) [`数据流`](/leetcode/outline/tag/data-streams.md) `2+` | <font color=#ff334b>Hard</font> |
738738
| 0023 | [合并 K 个升序链表](https://leetcode.com/problems/merge-k-sorted-lists/) | [JS](https://2xiao.github.io/leetcode-js/leetcode/problem/0023) | [`链表`](/leetcode/outline/tag/linked-list.md) [`分治`](/leetcode/outline/tag/divide-and-conquer.md) [`堆(优先队列)`](/leetcode/outline/tag/heap-priority-queue.md) `1+` | <font color=#ff334b>Hard</font> |
739739
| 0218 | [天际线问题](https://leetcode.com/problems/the-skyline-problem/) | | [`树状数组`](/leetcode/outline/tag/fenwick-tree.md) [`线段树`](/leetcode/outline/tag/segment-tree.md) [`数组`](/leetcode/outline/tag/array.md) `4+` | <font color=#ff334b>Hard</font> |
740740

0 commit comments

Comments
 (0)