Time and Space Complexity of list to str conversion in Python

Viewed 4520

Trying to find out what is the time complexity of casting to string

str([1,2,6,...,3,6])

Pretty sure it's O(1) Not sure how to verify.

Edit: about space complexity, That should not be linear to list size, thinking O(1) because string has max size.

1 Answers
Related