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)
Is this O(1) or O(n)?
|
|
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
|