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 <rajeevprasa...@gmail.com>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 algogeeks@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. > -- 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 algogeeks@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.