@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
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
@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
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
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(
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
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
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,
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
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
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
11 matches
Mail list logo