Python Forum
Time complexity of dict vs attributes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Time complexity of dict vs attributes
#6
So
len_cumsum = len(self.data[dest+'_cumsum'])
will ask whatever object is associated with dest+'_cumsum' for its length.

len_cumsum = len(self.data[dest+'_cumsum'][:])
will recreate the list inside len(). Will that list be a deep or a shallow copy? Is there a way to tell?
Reply


Messages In This Thread
Time complexity of dict vs attributes - by heras - Aug-23-2018, 08:12 PM
RE: Time complexity of dict vs attributes - by heras - Aug-24-2018, 10:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What is the run time complexity of this code and please explain? samlee916 2 2,330 Nov-06-2020, 02:37 PM
Last Post: deanhystad
  Basic Time Complexity Help Adakip 1 1,859 Aug-25-2019, 09:12 AM
Last Post: ThomasL
  [split] Time Complexity of Counting Mekire 9 7,788 Jan-10-2019, 11:09 AM
Last Post: Gribouillis
  How to calculate the mccabe complexity in module falke8? fuqianz 1 3,153 Oct-16-2017, 02:08 AM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020