[18.104.22.168/dictionary] Change sorting order?
neilc at norwich.edu
Fri Jan 22 17:52:05 CET 2010
On 2010-01-22, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
>> O(N*Log N) + O(N) == O(N**2)?
> Oops! :(
> Of course, the sort is in fast C, and the linear search is in
> relatively slow Python, so it is quite conceivable that for
> realistic amounts of data, the time could be dominated by the
> Or the OP might just change his requirements and allow starting
> the display in the middle of the letter.
That's what I would advocate. The scheme of starting at a random
(or cycling through) first letters still grants an arbitrary
advantage to some user names. A random starting position is thus
more fair *and* more efficient. ;)
More information about the Python-list