Consider using something like
StringBuilder sb = new StringBuilder();
for(int i = 0; i < n; i++){
sb.append('a');
}
Is the efficiency of the code O(N^2)
or O(N)
?
它是O(N),这意味着要花n
变量多大的代价。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.