Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion problems/0037.解数独.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class Solution {
}
```
解法二(bitmap标记)
```
```java
class Solution{
int[] rowBit = new int[9];
int[] colBit = new int[9];
Expand Down
2 changes: 1 addition & 1 deletion problems/0134.加油站.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Solution {
}
}
```
```
```java
// 解法3
class Solution {
public int canCompleteCircuit(int[] gas, int[] cost) {
Expand Down
2 changes: 1 addition & 1 deletion problems/kamacoder/图论并查集理论基础.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ void join(int u, int v) {

其实我们在优化并查集查询效率的时候,只用路径压缩的思路就够了,不仅代码实现精简,而且效率足够高。

按秩合并的思路并没有将树形结构尽可能的扁平化,所以在整理效率上是没有路径压缩高的
按秩合并的思路并没有将树形结构尽可能的扁平化,所以在整体效率上是没有路径压缩高的

说到这里可能有录友会想,那在路径压缩的代码中,只有查询的过程 即 find 函数的执行过程中会有路径压缩,如果一直没有使用find函数,是不是相当于这棵树就没有路径压缩,导致查询效率依然很低呢?

Expand Down