Professional Documents
Culture Documents
2.QuizStringsSTL (Quiz)
2.QuizStringsSTL (Quiz)
0.strtok()
1.strcpy()
2.strchr()
3.memset()
0.sort(S,S+S.size())
1.sort(S.begin(),S.end())
2.S.sort(S,S+S.size())
3.None
0.4
1.5
2.7
3.6
0.All of them.
1.int i=0,j=s.length()-1; while(i<=j)swap(s[i],s[j]);l++;j--;
2.reverse(s.begin(),s.end())
3.void reverseString(string &s){ if(s.length()<=1)return ;
swap(s[0],s[s.legnth()-1]); reverseString(s.begin()+1,s.rbegin()+1);
}
0.6054854654
1.6054854660
2.5486054654
3.6060606060
5. Title: String STL 08
Description: What does a.find(b) function for a string returns for a pair of string
a and b?
0.None
1.S.length()
2.s.len()
3.S.size()
Void f(){
0.Blocks
1.bingBlocks
2.None
3.Some hexadecimal number
0.KMP
1.Convex Hull
2.Kadane
3.Dutch National Flag Algorithm
void f(){
string s=”abhuhba” ;
bool flag=true;
for(int i=0;i<s.length()/2;i++)
if(s[i]!=s[s.length()-1-i])flag=false;
if(flag)cout<<”YES”;
else cout<<”NO”;
```
0.No
1.Yes
2.YES
3.NO