For this for loop, is the run time O(n) or O(n^2):
char[] ar = new char[1000];
String s = "";
Arrays.fill(ar, 'a');
for(Character c: ar){
s += c;
}
So basically, what is the run time of + on a String? How does it work behind the scene in Java?
See Question&Answers more detail:os