in reply to Link Connectivity Algorithim

The danger of presenting your problem with a single example is that people waste time coming up with solutions that aren't going to work for you.

What for instance is supposed to happen if %T1 contains 'b|d' => 'b|d' instead of 'c|d' => 'c|d'? Or is that not allowed? (In which case, the solution seems to be very easy).

Replies are listed 'Best First'.
Re^2: Link Connectivity Algorithim
by dunkirk_phil (Novice) on Oct 30, 2006 at 11:28 UTC
    Sorry this is my first post. To answer your question
    'b|d' => 'b|d'
    is not allowed
      So what *is* allowed? Can you have 'a|b' => 'b|c'? Can you have 'a|b' => 'b|a'? Can you have 'a|b|c' => 'x|y'? 'a|b' => 'x|y|z'? Be more specific on the constraints. (Your constraints will make the difference between a cubed, O(n log n) or a linear solution, so they are important).
        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.