How about using quicksort and then comparing adjacent elements (characters) and then finding the uniqueness and deleting repeated characters ?
On Sat, Jul 23, 2011 at 4:38 PM, Akshata Sharma <[email protected]>wrote: > @akash, the questions says no addition DS should be used. Its asks for > inplace algorithm. > @chinna, can you explain how heapsort will do it? > > > On Sat, Jul 23, 2011 at 3:17 PM, pacific :-) <[email protected]>wrote: > >> heapsort ? >> >> On Sat, Jul 23, 2011 at 1:26 PM, Akshata Sharma < >> [email protected]> wrote: >> >>> better than O(n^2).. >>> >>> >>> On Sat, Jul 23, 2011 at 1:08 PM, Akshata Sharma < >>> [email protected]> wrote: >>> >>>> Given a string *Str of ASCII characters, write the pseudo code to remove >>>> the duplicate elements present in them. For example, if the given string is >>>> "Potato", then, the output has to be "Pota". Additional constraint is, the >>>> algorithm has to be in-place( no extra data structures allowed) . Extend >>>> your algorithm to remove duplicates in the string which consisted of >>>> UNICODE >>>> characters. >>>> >>>> >>> >>> -- >>> 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. >>> >> >> >> >> -- >> regards, >> chinna. >> >> -- >> 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. >> > > -- > 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. > -- Regards Rajeev N B <http://www.opensourcemania.co.cc> -- 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.
