Time complexity of string concatenation in Python
I’m analysing the complexity of my code. From what I found online, since strings are immutable in python, a concatenation of a string and a character should be O(len(string) + 1). Now, here is my piece of code (simplified): word = "" for i in range(m): word = char_value + word return word The total … Read more