qguv / unionfind

a couple different implementations of union-find in the Go language (golang)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

value receiver may incur linear time here - because of pass-by-value?

akraievoy opened this issue · comments

Huh, I must have been assuming the slice within the struct is passed by reference (like a C array). Does it perform better if you change these methods to methods on pointers to UnionFind structs? If so, make a patch and I'll merge it!

The last link 404s for me. Maybe you need to be logged in to see that page?

Thanks for bringing this up!