sorting a dictionary

Paul Rubin phr-n2003b at NOSPAMnightsong.com
Tue Feb 4 20:53:14 EST 2003


"Giovanni Bajo" <noway at sorry.com> writes:
> Doesn't d[k] require O(logN) too? Or is Python smart enough to
> optimize this away since we are going through the dictionary?

Dictionary access is supposed to be constant time (hash lookup).




More information about the Python-list mailing list