[algogeeks] Re: To get length K sub-sequence strings fast?

2006-05-16 Thread Kevin
Hi Gene, Can you add some explanation to the code? Thanks a lot. :-) --~--~-~--~~~---~--~~ 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

[algogeeks] Re: To get length K sub-sequence strings fast?

2006-05-16 Thread hessam
There is a problem with that algorithm. It may print the same string more than once: e.g. for input abb and K = 2, it will print: ab ab I recommend storing the strings in a trie. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[algogeeks] Re: To get length K sub-sequence strings fast?

2006-05-16 Thread adak
Oddly enough, the links on the right hand side of this page have a very interesting bit-packing way of doing this. The link is: http://www-igm.univ-mlv.fr/~lecroq/string/node6.html It includes a truth table and a java applet visualization, along with a program in 'C'. The program example

[algogeeks] Re: To get length K sub-sequence strings fast?

2006-05-15 Thread Gene
Kevin wrote: Hi guys, How can we do this efficiently: Given a string S. Find all the sub-sequence strings that are of length K. For example, given abcd, and lenght k = 3, we will have: abc, abd, acd, bcd. /* Think recursively! */ void print_all_subsequences(char *s, int is, char *r,