isalnum(char) is a method which tells us, whether a given character is alphanumeric or not. What is the time complexity of this small function?
I have written a small subroutine :
bool check(string s,int i)
{
if((s[i]>='a' && s[i]<='z') ||
(s[i]>='0' && s[i]<='9') ||
(s[i]>='A' && s[i]<='Z'))
{
return true;
}
return false;
}
Is the above subroutine works same as isalnum(char) method? Are there time complexities same?