string getStringWithoutDuplicateChars(string input)
{
create_empty_trie_ds (say trie)
integer count = 0;
for_each_char_in_string (say ch)
{
if(trie->contains(ch)) //if ch not there in ds then add it and return
false otherwise return true
{
input.remove(count)
}
count++
}
return input
}
On Sat, May 28, 2011 at 11:32 AM, Rajeev Kumar <[email protected]>wrote:
> Design an algorithm and write code to remove the duplicate characters in a
> string without using any additional buffer.
> NOTE: One or two additional variables are fine.
> An extra copy of the array is not.
>
>
> --
> Thank You
> Rajeev Kumar
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
Thanks & Regards,
Saurabh
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.