Stefan Behnel <[EMAIL PROTECTED]> writes:

> [EMAIL PROTECTED] wrote:
>> im writing a webcrawler.
>> after visiting a new site i want to store it in alphabetical order.
>> 
>> so obv i want fast insert. i want to delete duplicates too.
>> 
>> which datastructure is best for this?
>
> Keep the data redundantly in two data structures. Use collections.deque() to
> append and remove as in a queue, and set() to find duplicates.
>

what about heapq for sorting? 

-- 

Rodrigo Lazo (rlazo)

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to