in reply to Re^3: Link Connectivity Algorithim
in thread Link Connectivity Algorithim

Basically the key matches its value, so even 'a|b => b|a' is illegal. Also the size of the key/value is 2. So values like 'a|b|c' are illegal because its size is deemed as 3.

Replies are listed 'Best First'.
Re^5: Link Connectivity Algorithim
by Anonymous Monk on Oct 30, 2006 at 15:02 UTC
    If the value has to match the key, the values are redundant. You may as well specify an array.

    However, it's clear that the above rules aren't complete. After all, 'a|b', 'b|c', 'b|d', is illegal, yet all values contain two points.

    It could very well be that all you require is an implementation of a Union-Find algorithm (which runs in time O(N ack-1N)), but without a good specification, we can't be sure.