3 ms·
ASCII can be stored in a byte, so at most he is going to use 256*(index+length). Assuming he doesn't have more than 2^64 byte of data, he will only need 24576
by tomjen3 16y ago
ASCII can be stored in a byte, so at most he is going to use
256*(index+length).
Assuming he doesn't have more than 2^64 byte of data, he will only need 24576 bytes to the index, and only 32768 if he needs a 64 bit, rather than a 32 bit length.
You might even not need the length argument as it is only the next array index subtracted from the current. In that case you need only 16384 bytes.
If you want two bit unicode, you have to use 49152, 65536 and 32768 bytes, respectively.
Remember he only wanted to index the first value.