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) == '\0') *(str+1)='\0'; if ( i>1) { i--; temp = str ; while ( *(str+i) !='\0' ) { *(str) = *(str+i); ++str; } str = temp ; } remove_duplicate(str +1); } } hope this is correct. On Sep 20, 3:10 pm, "LG JAYARAM ." <lgj...@gmail.com> wrote: > Yes ur correct...it will require some extra space....bst can be represented > in the array form rite....let me think in tht logic. > > On 9/19/10, Umer Farooq <the.um...@gmail.com> wrote: > > > > > > > creating a bst would require extra space. You can do this with an array of > > char dude. > > > On Sun, Sep 19, 2010 at 3:31 PM, LG JAYARAM . <lgj...@gmail.com> wrote: > > >> hi buddy ...Im clear with the idea....hereby I share the concept... > > >> wat exactly need to be done to solve this task is....better create a > >> Binary search tree...the Binary search tree will not allow duplicates and > >> If > >> u perform a inorder traversal....u can get the result...the task is > >> over....simple and thts it. > > >> On Sat, Sep 18, 2010 at 11:12 PM, jagadish <jagadish1...@gmail.com>wrote: > > >>> You are given a string which is sorted.. Write a recursive function to > >>> remove the duplicate characters in the string. > >>> eg: potatoeos > >>> output: potaes > >>> NO extraspace like hash/ bitmaps.. > > >>> -- > >>> You received this message because you are subscribed to the Google Groups > >>> "Algorithm Geeks" group. > >>> To post to this group, send email to algoge...@googlegroups.com. > >>> To unsubscribe from this group, send email to > >>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups > >>> .com> > >>> . > >>> For more options, visit this group at > >>>http://groups.google.com/group/algogeeks?hl=en. > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "Algorithm Geeks" group. > >> To post to this group, send email to algoge...@googlegroups.com. > >> To unsubscribe from this group, send email to > >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups > >> .com> > >> . > >> For more options, visit this group at > >>http://groups.google.com/group/algogeeks?hl=en. > > > -- > > Umer > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to algoge...@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups > > .com> > > . > > For more options, visit this group at > >http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.