Nexient interview question

What is the difference between string concatenation and string builder?

Interview Answer

Anonymous

Oct 21, 2016

String Concatenation operates on O(n^str.length) as we concatinate a string every iteration will take the previously written string rewrite it and append the new character each time. whereas string builder operates in O(n) as it only appends on letter at the time to what it has.