There's more than one way to do things | |
PerlMonks |
Re: Data structure challengeby gjb (Vicar) |
on Mar 17, 2004 at 18:11 UTC ( [id://337447]=note: print w/replies, xml ) | Need Help?? |
Trouble is caused by initialisation, so what data structure to use that is initialized in constant time? The answer may be to use simple strings for A and B. The length should be U*log_10(U) so that each group of log_10(U) characters represents an "array element". Initialisation can be done using pack that should be constant time, array access can be simulated using substr which is also constant time. Just my 2 cents, might be totally wrong, -gjb-
In Section
Meditations
|
|