Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this O(1) or O(n)?
#2
O(1) (n being the length of str1 or str2) would mean that the calculation time is independent of the length of str1 or str2, which is not the case. So for me it is O(n). For space, it is definitively O(n)
Reply


Messages In This Thread
Is this O(1) or O(n)? - by hshivaraj - Dec-17-2017, 02:36 PM
RE: Is this O(1) or O(n)? - by squenson - Dec-17-2017, 03:54 PM
RE: Is this O(1) or O(n)? - by hshivaraj - Dec-17-2017, 04:23 PM
RE: Is this O(1) or O(n)? - by Mekire - Dec-17-2017, 05:20 PM
RE: Is this O(1) or O(n)? - by hshivaraj - Dec-17-2017, 05:26 PM
RE: Is this O(1) or O(n)? - by wavic - Dec-17-2017, 05:32 PM
RE: Is this O(1) or O(n)? - by micseydel - Dec-17-2017, 08:50 PM

Forum Jump:

User Panel Messages

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