(self, x)
| 20 | self.rank = {elem: 0 for elem in elements} |
| 21 | |
| 22 | def find(self, x): |
| 23 | if self.parent[x] != x: |
| 24 | self.parent[x] = self.find(self.parent[x]) # Path compression |
| 25 | return self.parent[x] |
| 26 | |
| 27 | def union(self, x, y): |
| 28 | root_x, root_y = self.find(x), self.find(y) |
no outgoing calls
no test coverage detected