3 ms·
That being said, in some languages string1 + string2 + ... + stringn isn't an O(n^2) operation. (Notably, if your string type is a rope, or if the language has
by TheLoneWolfling 12y ago
That being said, in some languages string1 + string2 + ... + stringn isn't an O(n^2) operation. (Notably, if your string type is a rope, or if the language has a nary string concatenation operator, or is guaranteed to use something along the lines of a StringBuffer intermediary object)