A *trie *could help here where the number of children for each node matches the required length.
On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal <kamakshi...@gmail.com>wrote: > given a set of letters and a length N, produce all possible output.(Not > permutation). For example, give the letter (p,o) and length of 3, produce > the following output(in any order you want, not just my example order) > > ppp ppo poo pop opp opo oop ooo > > another example would be given (a,b) and length 2 > > answer: ab aa bb ba > > -- > Regards, > Kamakshi > kamakshi...@gmail.com > > -- > 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 and regards, Raghavan.K.L <http://in.linkedin.com/in/raghavankl> -- 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.