soluntion for 1ST question is :http://ideone.com/LSOj6
# include<cstdio># include<cstring>char checknonrepeat(char *a,int
*b,int n){
int i;
for(i=0;i<n;i++)
{
if(b[a[i]]==1)
break;
}return a[i];}int main(){
int b[300]={0};
char a[]="teeter";
int n=strlen(a);
int i;
for(i=0;i<n;i++)
b[a[i]]++;
printf("NON REPEATED CHAR=%c\n",checknonrepeat(a,b,n));
return 0;}
complex O(lenght of string)
plz correct me if i am wrong..........
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.