Complexity?

Revision en1, by Rajan_sust, 2017-12-17 04:59:25

If a String is : "Topcoder" and all of it's suffix are :

r,er,der,oder........pcoder,Topcoder

Now consider c++ code:

std::string str = "Topcoder";
const char* pointer = &str[1];
cout<<pointer<<'\n';

Output is: opcoder

What is the complexity of generating of above suffix upto 1 index of length 7? Linear or Constant ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Rajan_sust 2017-12-17 04:59:25 375 Initial revision (published)