[fpc-devel] Re: enumerators
vincent.snijders at gmail.com
Sun Nov 14 15:33:59 CET 2010
2010/11/14 Thaddy <thaddy at thaddy.com>:
> On 14-11-2010 13:22, Vincent Snijders wrote:
>> would be evaluated every time. S
>> the O(N^2) stems from the fact that it is hard to get the ith
>> character in a a UTF8String in O(1). Suppose it is o(N), then the loop
>> is O(n^2).
> "Hard to" is implementation detail and not part of any algorithm. A
> translation table goes a long way in implementing your example efficiently.
I did not have in mind such a sophisticated UTF8 string
implementation, that included a translation table for easy indexing.
More information about the fpc-devel