sorting a dictionary

Paul Rubin phr-n2003b at NOSPAMnightsong.com
Wed Feb 5 02:53:14 CET 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