This code works perfectly. Try out with different test data.
int main()
{
    //char str[]="qwertyuioplkjhgfdsazxcvbnm";
    char str2[] = "qwertyquejolpd";
    int val, i;
    int len = strlen(str);
    int unique=1;
    int checker=0;
    for(=0;i<len;i++)
    {
       val = str[i]-'a';
      if( (checker & (1<<val)) > 0 )
          {
             printf("\nNo, there aren't unique.");
             unique=0;
             break;
          }
       checker |= (1<<val);
    }
    if(unique==1)
     printf("\nUnique charaters.");
    return 1;
}


On Sat, Jul 23, 2011 at 12:18 PM, rajeev bharshetty <rajeevr...@gmail.com>wrote:

> @Victor : Counting sort uses extra data structures to maintain the count
> and the output array , so it is not viable I think ?? what say ??
>
>
> On Sat, Jul 23, 2011 at 11:04 AM, Victor Manuel Grijalva Altamirano <
> kavic1.mar...@gmail.com> wrote:
>
>> Use a type of counting sort with ascii
>>
>>
>> 2011/7/22 SkRiPt KiDdIe <anuragmsi...@gmail.com>
>>
>>> Use 8 mask integers or 4 LL to cover the complete ascii range.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Victor Manuel Grijalva Altamirano
>> Universidad Tecnologica de La Mixteca
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Rajeev N B <http://www.opensourcemania.co.cc>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Regards
Reynald Reni
Masters in Software Engineering
CIT - India

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to