Content deleted Content added
m Fix Linter obsolete tag errors. |
|||
Line 31:
label = zeros[n_columns, n_rows]
labels = [0:n_columns*n_rows] /* Array containing integers from 0 to the size of the image. */
for x in 0 to n_columns {
for y in 0 to n_rows {
Line 50 ⟶ 51:
'''Union'''
void union(int x, int y)
labels[find(x)] = find(y);
}
'''Find'''
int find(int x)
int y = x;
while (labels[y] != y)
y = labels[y];
while (labels[x] != x) {
int z = labels[x];
Line 64 ⟶ 67:
x = z;
}
return y;
}
|