O(n) for both space and time....... count the number of times each character is coming = O(n) space in worst case start from the string beginning if character has count == 1 print it O(n) in worst case this works with ASCII characters... since we can hash them on their values 0, 255.......... for languages like hindi, german don't know :)
On Mon, Jul 18, 2011 at 7:35 PM, hary rathor <[email protected]> wrote: > can anybody tell me in O(n) solution,? > > > -- > 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.
