Re: [algogeeks] Unique characters in a string

2011-07-25 Thread kashish jain
@reynald : I think your code takes care of only 32 ascii characters...and not 256 On Sat, Jul 23, 2011 at 10:07 AM, keyan karthi keyankarthi1...@gmail.comwrote: yup tat should work fine :) :) On Sat, Jul 23, 2011 at 10:03 AM, rajeev bharshetty rajeevr...@gmail.comwrote: Use Quick

Re: [algogeeks] Unique characters in a string

2011-07-25 Thread UTKARSH SRIVASTAV
please write your logicnot able to understand your code.. On Sat, Jul 23, 2011 at 12:12 AM, Reynald Suz reynaldsus...@gmail.comwrote: This code works perfectly. Try out with different test data. int main() { //char str[]=qwertyuioplkjhgfdsazxcvbnm; char

Re: [algogeeks] Unique characters in a string

2011-07-23 Thread rajeev bharshetty
@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

Re: [algogeeks] Unique characters in a string

2011-07-23 Thread keyan karthi
yup tat should work fine :) :) On Sat, Jul 23, 2011 at 10:03 AM, rajeev bharshetty rajeevr...@gmail.comwrote: Use Quick sort to sort the characters of a string (qsort is inplace sorting ) then check for consecutive characters in the array, if they are same then the string is not unique else

Re: [algogeeks] Unique characters in a string

2011-07-23 Thread Reynald Suz
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;ilen;i++) { val = str[i]-'a'; if(

[algogeeks] Unique characters in a string

2011-07-22 Thread Reynald
Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? -- 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

Re: [algogeeks] Unique characters in a string

2011-07-22 Thread keyan karthi
u can use an integer as a bit mask to do this... by setting the alphabet-'a' th bit, and checking the same.. On Sat, Jul 23, 2011 at 9:52 AM, Reynald reynaldsus...@gmail.com wrote: Implement an algorithm to determine if a string has all unique characters. What if you can not use

Re: [algogeeks] Unique characters in a string

2011-07-22 Thread Ankur Khurana
what if cahrs are in ascii code range and not just characters. Any solution for that ? On Sat, Jul 23, 2011 at 9:57 AM, keyan karthi keyankarthi1...@gmail.comwrote: u can use an integer as a bit mask to do this... by setting the alphabet-'a' th bit, and checking the same.. On Sat,

Re: [algogeeks] Unique characters in a string

2011-07-22 Thread rajeev bharshetty
Use Quick sort to sort the characters of a string (qsort is inplace sorting ) then check for consecutive characters in the array, if they are same then the string is not unique else unique .(use builtin qsort in C .) No additional data structure is used ... What do u think of this guys ?? On

Re: [algogeeks] Unique characters in a string

2011-07-22 Thread SkRiPt KiDdIe
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

Re: [algogeeks] Unique characters in a string

2011-07-22 Thread Victor Manuel Grijalva Altamirano
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