use hashing and then one more traversal.....O(n) see this post method 2--> http://geeksforgeeks.org/?p=21
they have explained it quite well !! -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Sat, Jul 30, 2011 at 1:11 PM, Ankur Khurana <ankur.kkhur...@gmail.com>wrote: > use bit manipulation to use an integer as a hash table. set bits to hash > the alphabets . . . > > > On Sat, Jul 30, 2011 at 1:10 PM, Karthikeyan palani < > karthikeyan...@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. >> >> -- >> karthikeyankkn >> >> -- >> 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. >> > > > > -- > Ankur Khurana > Computer Science > Netaji Subhas Institute Of Technology > Delhi. > > -- > 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. > -- 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.