RE: 알고리즘 이야기

You are viewing a single comment's thread from:

알고리즘 이야기

in kr-dev •  7 years ago  (edited)

C++ 일부 STL의 크기 판별 함수가 O(n)이더라고요.
JAVA나 javascript는 따로 문서를 봐야 알 수 있을 것 같습니다

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

C 는 zero terminated string 이라서 len(str) 은 O(n) 입니다.
자바의 경우 String 은 객체로 취급하며 내부적으로 length 를 가지고 있습니다.
참고로 자바 String 은 Constant 이므로 length 가 변하지 않습니다.