On 2006-02-08, News <[EMAIL PROTECTED]> wrote:
> I am new in using Python
>
> Anyone know how to implement breadth first search using Python?  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?
>
> Please send mail to me at [EMAIL PROTECTED] or reply this mail
>
> Thanks a lot!
>

Yes.  List has methods that support a stack, in case you find it useful
in this context.

Yes.  List has methods that allow dynamic creation, such as might be
useful when implementing a stack, in case you find it useful in this
context.

And Yes.  File has methods that will populate a list from a file.
Examples are in the tutorials.

You're welcome.

You can find numerous examples of the breadth-first algorithm on the
web.  You can then take the individual steps and translate them into
Python.  You'll likely find one or two sticking points, but the
implementation is straightforward from pseudocode or from a GOOD
statement of the algorithm.

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

Reply via email to