Current location - Quotes Website - Personality signature - JAVA super-long string problem
JAVA super-long string problem
For such a problem, we can usually deal with it in segments and divide it according to a certain length. When we need to find a specific number, we must first find the segment where the number is located, and then search in the segment.

For example, if 1000 is segmented, then the data of 1000 will be divided into 1000 segments. When you look for 987654 bits,

It becomes 987654/ 1000=987 and 654, so in stringbuffer[986], it starts with 653, right?

Of course, this kind of processing, if you want to do operations and other processing, you need to write the algorithm of subsection operation.

Of course, this is just a topic of discussion. In practice, we need to write faster algorithms, such as using multiple mapping tables to make indexes.