Best data structure for DFS on large graphs

Miheer Dewaskar miheer.dew at gmail.com
Tue Jul 3 09:39:44 EDT 2012


On Tue, Jul 3, 2012 at 4:53 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>
> Miheer Dewaskar, 03.07.2012 13:11:
> > I am not sure,but if there are large number of states Dictionaries wont
> > help much right?
>
> Dicts are fast for lookup, not for searching.
>
What do you mean by searching in the context of Dicts?

> > Anyway, does python have a built-in BST like data-structure ?
>
> It has lists and bisect:
>
> http://docs.python.org/library/bisect.html

But insertion and deletion in a list is o(n):

http://wiki.python.org/moin/TimeComplexity/#list




--
Miheer Dewaskar



More information about the Python-list mailing list