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]; 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) { 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函数,是不是相当于这棵树就没有路径压缩,导致查询效率依然很低呢?