Thank you. This solution is much quicker, since the list of keys is kept in 
order!

On Wednesday, July 3, 2013 8:38:20 PM UTC-5, Volker Braun wrote:
>
> Keep both a set(<keys>) and a dictionary {key:value}. Insert and delete on 
> both to keep them in sync.
>
> On Wednesday, July 3, 2013 9:24:42 PM UTC-4, Sam Math wrote:
>>
>> So as you can see, I'm adding 2 elements (in this case, the values are 
>> 1... but I have specific values in my program) to the dictionary, but 
>> removing the "first" (in the sense of its key). Calling the "min" function 
>> seems to be taking time, which is understandable.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to