Skip to content

Instantly share code, notes, and snippets.

Created January 27, 2018 14:55
Show Gist options
  • Save anonymous/9da888d88f741ccff47cee673b926783 to your computer and use it in GitHub Desktop.
Save anonymous/9da888d88f741ccff47cee673b926783 to your computer and use it in GitHub Desktop.
type
Structures* {.pure.} = enum
QuickFindUF, QuickUnionUF
type
QuickFindUF* = object
id: seq[int]
proc newUF[structureType: Structures.QuickFindUF](n: int): QuickFindUF =
result.id = newSeq[int](n)
for i in 0 .. <n:
result.add(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment