yash.girdhar
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
bool isNumber(char *s) {
if (s == NULL || *s == '\0')
return 0;
char * p;
strtod (s, &p);
// cout<<p<<endl;
if(!strcmp(s," "))
return false;
if(*p==' '){
// cout<<"if\n";
while(*p==' ')
p++;
}
// cout<<strlen(p)<<endl;
return (*p == '\0' || !strlen(p)>0);
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
O(nlogm):
for each element in A, use Binary Search method to find the element with the closest value in array B.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
for a particular word:
It works for all cases:
- yash.girdhar January 28, 2014