-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
195 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/leetcode/0075.sort-colors/assets/three-pointers.drawio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<mxfile host="Electron" modified="2024-04-29T03:54:10.876Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.2.5 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="pgn4Ngm23POuHrjT8gHF" version="24.2.5" type="device"> | ||
<diagram name="Page-1" id="FFz-IKYpVYwWqBeR8RZv"> | ||
<mxGraphModel dx="1434" dy="835" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="0" /> | ||
<mxCell id="1" parent="0" /> | ||
<mxCell id="X5G5Bk8h1uoy_RTIXZDS-1" value="" style="group" vertex="1" connectable="0" parent="1"> | ||
<mxGeometry x="280" y="360" width="240" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="JE0PaYjt03FcT6Js5zKv-1" value="2" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#6c8ebf;strokeWidth=1;fontFamily=Ubuntu;fontSize=16;fontStyle=0;fillColor=#dae8fc;" parent="X5G5Bk8h1uoy_RTIXZDS-1" vertex="1"> | ||
<mxGeometry width="40" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="JE0PaYjt03FcT6Js5zKv-2" value="0" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#6c8ebf;strokeWidth=1;fontFamily=Ubuntu;fontSize=16;fontStyle=0;fillColor=#dae8fc;" parent="X5G5Bk8h1uoy_RTIXZDS-1" vertex="1"> | ||
<mxGeometry x="40" width="40" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="JE0PaYjt03FcT6Js5zKv-3" value="2" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#6c8ebf;strokeWidth=1;fontFamily=Ubuntu;fontSize=16;fontStyle=0;fillColor=#dae8fc;" parent="X5G5Bk8h1uoy_RTIXZDS-1" vertex="1"> | ||
<mxGeometry x="80" width="40" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="JE0PaYjt03FcT6Js5zKv-4" value="1" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#6c8ebf;strokeWidth=1;fontFamily=Ubuntu;fontSize=16;fontStyle=0;fillColor=#dae8fc;" parent="X5G5Bk8h1uoy_RTIXZDS-1" vertex="1"> | ||
<mxGeometry x="120" width="40" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="JE0PaYjt03FcT6Js5zKv-5" value="1" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#6c8ebf;strokeWidth=1;fontFamily=Ubuntu;fontSize=16;fontStyle=0;fillColor=#dae8fc;" parent="X5G5Bk8h1uoy_RTIXZDS-1" vertex="1"> | ||
<mxGeometry x="160" width="40" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="JE0PaYjt03FcT6Js5zKv-6" value="0" style="rounded=0;whiteSpace=wrap;html=1;shadow=0;strokeColor=#6c8ebf;strokeWidth=1;fontFamily=Ubuntu;fontSize=16;fontStyle=0;fillColor=#dae8fc;" parent="X5G5Bk8h1uoy_RTIXZDS-1" vertex="1"> | ||
<mxGeometry x="200" width="40" height="40" as="geometry" /> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 0075. 颜色分类 Sort Colors | ||
|
||
[问题描述](../problems/0075.sort-colors/content.html) | ||
|
||
## 靠拢型双指针 | ||
|
||
靠拢型双指针是一种常用方法, 这个解法是它的变体, 叫[DNF](../../two-pointers/close-up.md). | ||
|
||
```rust | ||
{{#include src/main.rs:7:40 }} | ||
``` | ||
|
||
## 排序法 | ||
|
||
各种常见的排序算法都可以, 比如括入排序, 选择排序. 因为这毕竟是一个排序题. | ||
|
||
```rust | ||
{{#include src/main.rs:47:56 }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 排序 | ||
|
||
## 简单 | ||
|
||
## 中等 | ||
|
||
1. [0075. 颜色分类 Sort Colors](../0075.sort-colors/index.md) | ||
|
||
## 困难 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../leetcode/0075.sort-colors/src/main.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters