Question: Data structures and algorithms Q 1 ) assume the number of characters in the string is n , not including the null terminator character. for
Data structures and algorithms Q assume the number of characters in the string is n not including the null terminator character.
for the following code write how many times each operation will be done at worstusing n
char replacechar str char oldChar, char newChar
int size lengthstr;
char newVer mallocsizesizeofchar;
forint i; i size; i
ifstrioldChar
newVerinewChar;
else newVeristri;
return newVer;
Q assume the number of characters in the string is n not including the null terminator character.
for the following code write how many times each operation will be done at worstusing n
char toUpperchar str
int size lengthstr;
char newVer mallocsizesizeofchar; forint i; i size; i
ifstria && striz newVeri stri;
else
newVeri stri;
return newVer;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
