Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I AM AN EXPERT PROGRAMMER

Name: Anonymous 2007-01-28 8:03

I have 20 years programming experience writing HUGE Programs that you couldnt even comprehend. I wrote an ANSI C compiler when I was 12 years old.

You should just accept everything I say, I dont HAVE to give any reasons for my arguments because I am an EXPERT PROGRAMMER.

Name: Anonymous 2007-01-29 20:13

>>26
No, he mentioned the 'extension words'; they're called surrogate pairs. Of course, you can't really have both surrogate support and O(1) indexing (unless you keep a pointer to every single character). You can optimize your implementation though. You could keep a flag that indicates whether the string doesn't have surrogate pairs (indexing is O(1)), has only surrogate pairs (also O(1)), or is mixed (indexing becomes more difficult). If you have long mixed strings and really need fast indexing for some reason, that's still fairly easy to optimize (eg. keep a table with pointers to every Nth char.. I suppose this would also be O(1)).

As for O(1) length, that's completely trivial, you just keep a separate byte count and char count in your string object.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List