Re: Queues - Is Infinity all right?

Discussion in 'Python' started by Rob Hunter, Oct 6, 2003.

  1. Rob Hunter

    Rob Hunter Guest

    On Sunday, October 5, 2003, at 09:53 PM, Jeremy Fincher wrote:

    > Rob Hunter <> wrote in message
    > news:<>...
    >> But it doesn't depend on such things. There is no cost. Check out
    >> the
    >> source code if you like. On my computer it's in /usr/lib/python<some
    >> version>/Queue.py

    >
    > That's where your wrong. list.pop(0) is an O(n) operation.


    And this O(n) operation is used no matter is a bound was chosen for the
    queue size, or not.

    Several people seemed to interpret the original question as, "What is
    the running time of the queue operations when there is an infinite
    bound on the size given?" I interpreted the original question to be,
    "Is anything saved, in terms of running time, by choosing some
    particular queue size bound instead of leaving the it unbounded?" And
    for that the answer is "No". Agreed?

    Above, when I wrote, "There is no cost", I should have written "There
    is no cost difference". But

    Rob
    Rob Hunter, Oct 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. a_Conan
    Replies:
    3
    Views:
    496
    a_Conan
    Sep 8, 2005
  2. Anand Pillai

    Queues - Is Infinity all right?

    Anand Pillai, Oct 5, 2003, in forum: Python
    Replies:
    9
    Views:
    303
    Ype Kingma
    Oct 8, 2003
  3. Rob Hunter

    Re: Queues - Is Infinity all right?

    Rob Hunter, Oct 5, 2003, in forum: Python
    Replies:
    1
    Views:
    300
    Jeremy Fincher
    Oct 6, 2003
  4. Skybuck Flying

    Infinity + Infinity (or NegInfinity - NegInfinity)

    Skybuck Flying, Oct 8, 2011, in forum: C Programming
    Replies:
    40
    Views:
    1,680
    Tim Rentsch
    Jan 25, 2012
  5. Jon A. Lambert

    Infinity and -Infinity

    Jon A. Lambert, Nov 5, 2005, in forum: Ruby
    Replies:
    3
    Views:
    324
    Trans
    Nov 6, 2005
Loading...

Share This Page