-
c++ 에서 +는 매번 string을 복사하는 연산이 아님(python과 다름)아무거나적어~ 2023. 12. 5. 10:34
String concatenation complexity in C++ and Java
Consider this piece of code: public String joinWords(String[] words) { String sentence = ""; for(String w : words) { sentence = sentence + w; } return sentence; } On each
stackoverflow.com
Time complexity of string concatenation in Python
I'm analysing the complexity of my code. From what I found online, since strings are immutable in python, a concatenation of a string and a character should be O(len(string) + 1). Now, here is my ...
stackoverflow.com
'아무거나적어~' 카테고리의 다른 글
Upper bound for number of divisors ~ O(N^1/3) (2) 2023.12.06 STL vector: resize() and assign() (0) 2023.12.05 와 ~ div 4 업솔 다함 >~< (1) 2023.11.27 15분 고민하고 답(정당성 + 구현 방법)이 떠오르지 않으면 다음문제로 넘기기 (0) 2023.11.20 LSB, MSB (0) 2023.11.08