Sorting speed improvement
David Faure
dfaure at klaralvdalens-datakonsult.se
Wed Apr 23 11:41:15 CEST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 23 April 2003 10:33, Jaime Torres wrote:
> >> // 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).
The locale-aware sorting rules are much more complex than that.
- --
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+plGr72KcVAmwbhARAi1EAJsHNNX9ZuSqJ5TBHaOQhyzeBP3/aQCaAt5O
zxwgnPJD43F8p3A14dQMYYc=
=Siwg
-----END PGP SIGNATURE-----
More information about the Kde-optimize
mailing list