"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).