From b6fc085d9eb78c73712a2c04a7e896b0163d5446 Mon Sep 17 00:00:00 2001 From: Kai Huang Date: Tue, 18 Nov 2025 10:32:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Fix=20Java=20=E4=BB=A3=E7=A0=81=E5=9D=97?= =?UTF-8?q?=E6=9C=AA=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA=20in=20=E8=A7=A3?= =?UTF-8?q?=E6=95=B0=E7=8B=AC.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "problems/0037.\350\247\243\346\225\260\347\213\254.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/problems/0037.\350\247\243\346\225\260\347\213\254.md" "b/problems/0037.\350\247\243\346\225\260\347\213\254.md" index 204f0cc092..786e2af6e3 100755 --- "a/problems/0037.\350\247\243\346\225\260\347\213\254.md" +++ "b/problems/0037.\350\247\243\346\225\260\347\213\254.md" @@ -290,7 +290,7 @@ class Solution { } ``` 解法二(bitmap标记) -``` +```java class Solution{ int[] rowBit = new int[9]; int[] colBit = new int[9]; From 698d9d4d46f43e4f4c068033997c2e13be105297 Mon Sep 17 00:00:00 2001 From: Kai Huang Date: Tue, 18 Nov 2025 10:37:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20Java=20=E4=BB=A3=E7=A0=81=E5=9D=97?= =?UTF-8?q?=E6=9C=AA=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA=20in=20=E5=8A=A0?= =?UTF-8?q?=E6=B2=B9=E7=AB=99.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "problems/0134.\345\212\240\346\262\271\347\253\231.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/problems/0134.\345\212\240\346\262\271\347\253\231.md" "b/problems/0134.\345\212\240\346\262\271\347\253\231.md" index 5c8b0c3cc8..09900d2543 100755 --- "a/problems/0134.\345\212\240\346\262\271\347\253\231.md" +++ "b/problems/0134.\345\212\240\346\262\271\347\253\231.md" @@ -247,7 +247,7 @@ class Solution { } } ``` -``` +```java // 解法3 class Solution { public int canCompleteCircuit(int[] gas, int[] cost) { From e446b348dcd184974f1df6e303954d998bd61d40 Mon Sep 17 00:00:00 2001 From: Kai Huang Date: Tue, 2 Dec 2025 12:49:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20=E9=94=99=E5=88=AB=E5=AD=97=20in=20?= =?UTF-8?q?=E5=9B=BE=E8=AE=BA=E5=B9=B6=E6=9F=A5=E9=9B=86=E7=90=86=E8=AE=BA?= =?UTF-8?q?=E5=9F=BA=E7=A1=80.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md" "b/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md" index 4db52c92bd..60c0633847 100644 --- "a/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md" +++ "b/problems/kamacoder/\345\233\276\350\256\272\345\271\266\346\237\245\351\233\206\347\220\206\350\256\272\345\237\272\347\241\200.md" @@ -407,7 +407,7 @@ void join(int u, int v) { 其实我们在优化并查集查询效率的时候,只用路径压缩的思路就够了,不仅代码实现精简,而且效率足够高。 -按秩合并的思路并没有将树形结构尽可能的扁平化,所以在整理效率上是没有路径压缩高的。 +按秩合并的思路并没有将树形结构尽可能的扁平化,所以在整体效率上是没有路径压缩高的。 说到这里可能有录友会想,那在路径压缩的代码中,只有查询的过程 即 find 函数的执行过程中会有路径压缩,如果一直没有使用find函数,是不是相当于这棵树就没有路径压缩,导致查询效率依然很低呢?