generate all possible DISTINCT permutations of a given string with some possible repeated characters. Use as minimal memory as possible. Time complexity should be as close as possible to actual number of permutations. For example if "aaaaaaaaaa" (10 a's) is given as input we should not be checking all 10! ways and returning just one string as output.
if given string contains n characters in total with m < n distinct characters each occuring n_1, n_2, ....n_m times where n_1 + n_2 + ...+ n_m = n program should generate n! / ( n_1! * n_2! * ....* n_m! ) strings. Ex: aba is given string Output: aab aba baa Ex2: aaa is given input string Output aaa -Thanks, Bujji -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.