A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/064905.html below:

[Python-Dev] binary trees.

[Python-Dev] binary trees. [Python-Dev] binary trees.Vladimir 'Yu' Stepanov vys at renet.ru
Sat May 6 11:31:54 CEST 2006
Martin v. Löwis wrote:
> Vladimir 'Yu' Stepanov wrote:
>   
>> Yes. I understood it when resulted a set example.
>>     
>>> However, as I just said, people usually don't remove items from
>>> just-sorted lists, they tend to iterate over them via 'for i in list:' .
>>>   
>>>       
>> Such problem arises at creation of the list of timers.
>>     
>
> For a list of timers/timeout events, a priority queue is often the best
> data structure, which is already available through the heapq module.
>   

It is in most cases valid so. heapq very much approaches for these purposes.
The unique problem is connected with removal of an any element from the 
list.

--
Vladimir Stepanov
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4