Re: len() on mutables vs. immutables

Discussion in 'Python' started by Demian Brecht, Oct 18, 2012.

  1. On 10/18/2012 11:28 AM, Nick Cash wrote:
    > It appears that list has len() complexity of O(1)
    > source: http://wiki.python.org/moin/TimeComplexity
    > It may be worth mentioning that lists in Python are implemented using arrays instead of linked lists.
    >
    > It's reasonable to assume that other built-in collection types would be similar, though I don't see anything explicitly saying so for bytearray.
    >
    > -Nick Cash


    Thanks for the link, I don't believe I had seen that one before.
    Demian Brecht, Oct 18, 2012
    #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. Demian Brecht

    len() on mutables vs. immutables

    Demian Brecht, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    96
    Demian Brecht
    Oct 18, 2012
  2. Terry Reedy

    Re: len() on mutables vs. immutables

    Terry Reedy, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    107
    Terry Reedy
    Oct 18, 2012
  3. Demian Brecht

    Re: len() on mutables vs. immutables

    Demian Brecht, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    110
    Demian Brecht
    Oct 18, 2012
  4. Nick Cash

    RE: len() on mutables vs. immutables

    Nick Cash, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    85
    Nick Cash
    Oct 18, 2012
  5. Prasad, Ramit

    RE: len() on mutables vs. immutables

    Prasad, Ramit, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    109
    Prasad, Ramit
    Oct 18, 2012
Loading...

Share This Page