[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.

Again, no ordering, but very fast insert/delete/dup-check.

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

Reply via email to