String length complexity...

Revision en2, by C137, 2015-11-17 20:18:08

String str;

cin>>str;

for(int i=0;i<str.length();i++){

....

}

if str.length()=n, then the total complexity of the algorithm is n*n?? or just n?

Tags string, algorithm complexity

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English C137 2015-11-17 20:18:08 24
en1 English C137 2015-11-17 20:14:36 175 Initial revision (published)