JamesG wrote:
>> No arithmetic required as such. I just need to extract digits at
>> certain positions in the array.
>> Could i do this like: array[i][300] to get the 299th digit of i'th
>> array?
> Do you know the max length for a given number in advance? If so,
> consider byte[][] array, and you would access array[i][300].
>
> If you don't know a reasonably accurate maximum length, consider using
> an array of StringBuilder. It will handle extending the array for you.
Or even List<StringBuilder>.
Then you can have an arbitrarily large list of arbitrarily large CharSequences
of varying lengths.
To the OP: Have you looked at the API docs for StringBuilder since Patricia
suggested the class?
BigInteger?
After those, look at List and its implementations.
If you don't research the suggestions how will you know if they'll help?
-- Lew
Patricia Shanahan - 07 Mar 2007 21:45 GMT
> JamesG wrote:
>>> No arithmetic required as such. I just need to extract digits at
[quoted text clipped - 19 lines]
>
> After those, look at List and its implementations.
I'd even consider an ArrayList of ArrayList of Byte, with just 10
distinct Byte objects, one for each value. It would cost a 32 or 64 bit
reference for each element, less space efficient than StringBuilder.
> If you don't research the suggestions how will you know if they'll help?
Especially important because I don't think we have been given enough
size and operation frequency data to actually pick a really good
structure. All we can do is suggest structures to consider.
Patricia