Types
RootValueUnionFind[T] = ref object count*: int par_or_siz: seq[int32] op: proc (x, y: var T) values*: seq[T]
- Source Edit
Procs
proc get[T](self: RootValueUnionFind[T]; x: int): var T
- Source Edit
proc initRootValueUnionFind[T](N: int; op: (proc (x, y: var T)); default: (proc (): T)): RootValueUnionFind[T]
- opについて、xのほうが新しくrootになるものとする(よって、xのサイズはyのサイズ以上である) 関数にvarで与えられるので、関数内でxを書き換えてください なんでこうしてるの? -> HashSetとかを載せてマージできると嬉しさがあるので。 Source Edit
proc initRootValueUnionFind[T](N: int; op: (proc (x, y: var T)); default: T): RootValueUnionFind[ T]
- opについて、xのほうが新しくrootになるものとする(よって、xのサイズはyのサイズ以上である) 関数にvarで与えられるので、関数内でxを書き換えてください なんでこうしてるの? -> HashSetとかを載せてマージできると嬉しさがあるので。 Source Edit
proc initRootValueUnionFind[T](N: int; op: (proc (x, y: var T)); values: openArray[T]): RootValueUnionFind[T]
- opについて、xのほうが新しくrootになるものとする(よって、xのサイズはyのサイズ以上である) 関数にvarで与えられるので、関数内でxを書き換えてください なんでこうしてるの? -> HashSetとかを載せてマージできると嬉しさがあるので。 Source Edit
proc issame[T](self: RootValueUnionFind[T]; x: int; y: int): bool
- Source Edit
proc root[T](self: RootValueUnionFind[T]; x: int): int
- Source Edit
proc set[T](self: RootValueUnionFind[T]; x: int; value: T)
- Source Edit
proc siz[T](self: RootValueUnionFind[T]; x: int): int
- Source Edit
proc unite[T](self: RootValueUnionFind[T]; x: int; y: int)
- Source Edit