Sorting speed improvement

Jaime Torres jtorres at sia.es
Wed Apr 23 11:33:27 CEST 2003


>> 	    // The good implementation needs 256 intermedate lists.
>> 	    // But does not need to copy elements from list to list
>> 	    // It is enought to move them (in a list implemented with
>> 	    // pointers, just move the pointer ).

> Unicode??? Should need 65536 list!

Yes, you are true. 
If Unicode is well formed and is suitable to be sorted like the
ASCII code, it is possible to do this using only 256 lists and accesing
first the low
byte of the unicode integer and then the high byte. 

The time will still be O(n).

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-optimize/attachments/20030423/9f633efa/attachment-0001.htm


More information about the Kde-optimize mailing list