On Feb 22, 12:40 pm, hg <[EMAIL PROTECTED]> wrote:
> John Machin wrote:
> > On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote:
> >> I want to write a code for Breadth First Traveral for Graph, which needs
> >> a queue to implement.
>
> >> I wonder that for such a powerful language as Python, wh
> For that purpose I have used the good deque that you can find in
> collections in the standard library. It's very good for queues, and
> it's a bit faster than regular lists for stacks too.
you mean *much* faster (since a list is a reference array so pop(0) is
O(n) operation)
never use a list a
John:
> I want to write a code for Breadth First Traveral for Graph, which needs a
> queue to implement.
For that purpose I have used the good deque that you can find in
collections in the standard library. It's very good for queues, and
it's a bit faster than regular lists for stacks too.
Bye,
b
John Machin wrote:
> On Feb 23, 11:24 am, "John" <[EMAIL PROTECTED]> wrote:
>
>>Than C or PASCAL
>>I mean, list or dictionary in Python are so powerful than the traditional
>>array. Maybe I can make use of it?
>
>
> Well, you could wite your own queue manager using Python lists,
> but ...
>
> Y
John wrote:
> I want to write a code for Breadth First Traveral for Graph, which needs a
> queue to implement.
>
> I wonder that for such a powerful language as Python, whether there is a
> better and simpler implementation for a traditional FIFO queue?
>
For a BFS I coded up a while back iterat
hg wrote:
> f u
"f o" of course
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote:
>> I want to write a code for Breadth First Traveral for Graph, which needs
>> a queue to implement.
>>
>> I wonder that for such a powerful language as Python, whether there is a
>> better and simpler implementation for a
On Feb 23, 11:24 am, "John" <[EMAIL PROTECTED]> wrote:
> Than C or PASCAL
> I mean, list or dictionary in Python are so powerful than the traditional
> array. Maybe I can make use of it?
Well, you could wite your own queue manager using Python lists,
but ...
You have this strange reluctance to lo
Than C or PASCAL
I mean, list or dictionary in Python are so powerful than the traditional
array. Maybe I can make use of it?
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote:
> > I want to write a code for Breadth F
On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote:
> I want to write a code for Breadth First Traveral for Graph, which needs a
> queue to implement.
>
> I wonder that for such a powerful language as Python, whether there is a
> better and simpler implementation for a traditional FIFO queue?
>
I want to write a code for Breadth First Traveral for Graph, which needs a
queue to implement.
I wonder that for such a powerful language as Python, whether there is a
better and simpler implementation for a traditional FIFO queue?
Thanks!
--
http://mail.python.org/mailman/listinfo/python-lis
11 matches
Mail list logo