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 to remove them and move the remaining elements forward.


On Sep 19, 3:50 am, 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.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to