On Thu, Apr 7, 2016 at 1:32 PM, Marko Rauhamaa <ma...@pacujo.net> wrote:
> Paul Rubin <no.email@nospam.invalid>:
>
>> Chris Angelico <ros...@gmail.com> writes:
>>> First off, what does it actually *mean* to have a tree with numbers
>>> and keys as strings? Are they ever equal? Are all integers deemed
>>> lower than all strings? Something else?
>>
>> If the AVL tree's purpose is to be an alternative lookup structure to
>> Python's hash-based dictionaries, then it doesn't really matter what
>> the ordering between values is, as long as it's deterministic.
>
> I use AVL trees to implement timers. You need to be able to insert
> elements in a sorted order and remove them quickly.

Why would AVL trees implementing timers ever need non-numeric keys though?

It seems to me that if you're mixing types like this then the ordering
is likely not actually important.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to