Re: connected?
dvanhorn <[email protected]>
| Newsgroups | gmane.org.ballistichelmet.lambda |
|---|---|
| Message-ID | <[email protected]> |
David Van Horn wrote:
> Aaron S. Hawley wrote:
>>start at some arbitrary element in S.
>>find it's connected set and "color" (mark as visited) each.
>>iterate through all elements in S verifying that they are present in the
>>connected set ("colored").
>
> This sounds right too. You visit each element and accumulate the set of
> elements it immediately touches. If s is connected, you'll generate the same
> set s by visiting all elements in s.
Nope, that ain't right. Consider (connected? '((1 1) (1 2) (7 8) (8 8)))
You color them all, but they are not connected. Mine gets this right. Who
would've thought set theory is your friend?
David