Pregunta de entrevista de Nexient

What is the difference between string concatenation and string builder?

Respuesta de la entrevista

Anónimo

21 de oct de 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.