[algogeeks] Re: recursion to remove duplicate characters in a string

2010-09-21 Thread abhishek
void remove_duplicate(char * str) { if (*str == '\0') return ; else { char ch = *str; char * temp ; int i = 0 ; while ( ch == *(str+i) ) { i++; } if ( *(str+i) == '

[algogeeks] Re: recursion to remove duplicate characters in a string

2010-09-19 Thread Minotauraus
Ummm and also, the potatoes example isn't a _**sorted string**_ as the problem statement said. All you have to do is pass the location of the current char and then compare it with the next one until you reach the end. Use a dynamic array or a list or something to store the chars in so it's easier t