laziness, impatience, and hubris | |
PerlMonks |
Re: Detecting transpositionsby dws (Chancellor) |
on Aug 06, 2003 at 16:30 UTC ( [id://281474]=note: print w/replies, xml ) | Need Help?? |
Efficiency is paramount.
Have you considered precomputing transpositions? Then, comp(A, B) becomes
If everything is in a big hash (i.e., if you've traded space for time), the lookup is quick. You could even do a lazy initialization of the transposition set.
In Section
Seekers of Perl Wisdom
|
|