[racket-dev] union-find

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Jan 29 19:51:53 EST 2013

But wouldn't that equate two un-unioned invocations of (uf-new 1)?

On Tue, Jan 29, 2013 at 7:47 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> But I should probably provide that, since it can be done more reliably
> inside the library.
>
> Robby
>
>
> On Tue, Jan 29, 2013 at 6:46 PM, Robby Findler <robby at eecs.northwestern.edu>
> wrote:
>>
>>
>>
>>
>> On Tue, Jan 29, 2013 at 4:20 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu>
>> wrote:
>>>
>>> This is probably a silly question, but don't you also need some way to
>>> check if two sets have been unioned?  Does your application not need
>>> that?
>>>
>>
>> You check to see if their canonical element is the same.
>>
>> Robby
>>
>>>
>>> Sam
>>>
>>> On Tue, Jan 29, 2013 at 4:51 PM, Robby Findler
>>> <robby at eecs.northwestern.edu> wrote:
>>> > I've just pushed an implementation of the union-find algorithm to the
>>> > data/
>>> > collection. I didn't do it quite the way wikipedia recommends, but
>>> > instead
>>> > made the sets be little containers whose canonical element can be
>>> > mutated.
>>> >
>>> > This suits my purposes well, but I wanted to ask if someone on the list
>>> > knows why the wikipedia way is better.
>>> >
>>> > Also, I wasn't sure about the names, so I put "uf-" on the front of
>>> > everything to discourage people from using this when they really want
>>> > racket/set. Maybe there is a better way, tho?
>>> >
>>> > Robby
>>> >
>>> >
>>> > _________________________
>>> >   Racket Developers list:
>>> >   http://lists.racket-lang.org/dev
>>> >
>>
>>
>

Posted on the dev mailing list.