> Date: Thu, 11 Apr 2002 15:28:36 +0100
> From: Adam Spiers <[EMAIL PROTECTED]>
> 
> These are two sides of the same coin, and not really very surprising,
> when you think about how modifying a key potentially means moving it
> to a new hash bucket.

That would be ugly. During the tournament, I did worry for a few
minutes about what would happen if the hash keys were modified. In my
solutions the keys never contained a newline, so I never tried to
change them --- but I see it wouldn't have mattered.

> If it was possible to modify keys, there may well have been a nice
> solution to TPR(0,2), which during the hash-building stage dynamically
> changed the keys so that they were always of the form
> 
>   join $;, 1 x $number_of_words_in_set, sort /./g
> 
> Then you could just do a
> 
>   print@h{sort%h}

In the same vein, I briefly played with the thought of emptying out
all keys and values that didn't have a newline, and successively
appending the ones left to a string. Wouldn't have worked with hash
keys either.

Lars Mathiesen (U of Copenhagen CS Dep) <[EMAIL PROTECTED]> (Humour NOT marked)

Reply via email to