Marco van de Voort schrieb:

At least the example code has to be made work, i.e. the nonsense statement
   DoSomething(ch(i));
has to be changed into something like
   DoSomething(GetUTF8char(s,i));
before we can can talk honestly about the order of the loop.

The other of the algorithm is then still O(n^2), since UTF8Char will already
be O(n)?

The total order will be something between O(n^1) and O(n^2), depending on many factors (what is "n"?...).

I also doubt that UTF8char is a reasonable type for the loop variable - IMO UTF32char were a much better choice...

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to