Skip to content

Commit 4bde2cc

Browse files
committed
📚 mysql lock
1 parent 6462a35 commit 4bde2cc

File tree

50 files changed

+8198
-8237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+8198
-8237
lines changed

docs/data-management/MySQL/MySQL-Lock.md

Lines changed: 70 additions & 90 deletions
Large diffs are not rendered by default.

docs/data-structure-algorithms/algorithm/Binary-Search.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public int findDuplicate(int[] nums) {
452452
>
453453
> 你可以假设 nums[-1] = nums[n] = -∞ 。
454454
>
455-
> 你必须实现时间复杂度为 O(log n) 的算法来解决此问题。
455+
> 你必须实现时间复杂度为 $O(log n) $的算法来解决此问题。
456456
>
457457
> ```
458458
> 输入:nums = [1,2,3,1]
@@ -471,11 +471,11 @@ public int findDuplicate(int[] nums) {
471471
472472
这题,最简单的思路就是直接找最大值,但这样复杂度是 $O(n)$
473473
474-
在二分查找中,每次会找到一个位置 midmid。我们发现,midmid 只有如下三种情况:
474+
在二分查找中,每次会找到一个位置 mid。我们发现,mid 只有如下三种情况:
475475
476-
- midmid 为一个峰值,此时我们通过比较 midmid 位置元素与两边元素大小即可。
477-
- midmid 在一个峰值右侧,此时有 nums[mid] < nums[mid + 1]nums[mid]<nums[mid+1],此时我们向右调整搜索范围,在 [mid + 1, r][mid+1,r] 范围内继续查找。
478-
- midmid 在一个峰值左侧,此时有 nums[mid] < nums[mid - 1]nums[mid]<nums[mid−1],此时我们向左调整搜索范围,在 [l + 1, mid][l+1,mid] 范围内继续查找。
476+
- mid 为一个峰值,此时我们通过比较 mid 位置元素与两边元素大小即可。
477+
- mid 在一个峰值右侧,此时有 nums[mid] < nums[mid + 1],此时我们向右调整搜索范围,在 [mid + 1, r] 范围内继续查找。
478+
- mid 在一个峰值左侧,此时有 nums[mid] < nums[mid - 1],此时我们向左调整搜索范围,在 [l + 1, mid] 范围内继续查找。
479479
480480
```java
481481
public int findPeakElement(int[] nums) {
@@ -517,20 +517,12 @@ public int findPeakElement(int[] nums) {
517517
>
518518
> 现有矩阵 matrix 如下:
519519
>
520-
> ```
521-
> [
522-
> [1, 4, 7, 11, 15],
523-
> [2, 5, 8, 12, 19],
524-
> [3, 6, 9, 16, 22],
525-
> [10, 13, 14, 17, 24],
526-
> [18, 21, 23, 26, 30]
527-
> ]
528-
> ```
529-
>
530-
> 给定 target = 5,返回 true。
531-
>
532-
> 给定 target = 20,返回 false。
533-
>
520+
> ![](https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/11/25/searchgrid2.jpg)
521+
>
522+
> ```
523+
> 输入:matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 5
524+
> 输出:true
525+
> ```
534526
535527
**思路**:
536528

node_modules/@vuepress/core/.temp/app-enhancers/global-components-4.js

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

node_modules/@vuepress/core/.temp/app-enhancers/global-components-5.js

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

node_modules/@vuepress/core/.temp/dynamic/vuepress_blog/frontmatterClassified.js

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)