breadth first search

Chris McDonough chrism at plope.com
Wed Feb 8 12:03:48 EST 2006


News wrote:
> I am new in using Python
> 
> Anyone know how to implement breadth first search using Python?

Breadth-first search of what?  It depends what kind of tree you're 
searching, but here's a page with a few implementations:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/231503

   Can Python
> create list dynamically, I want to implement a program which will read data
> from a file and store each line into a list, is this possible?

L = []
[L.append(line) for line in (open('filename.txt')]

- C



More information about the Python-list mailing list