well this question is different from the one where recursion makes more sense(telephone dial pad and gereate english char combinations for a given number)
int range = 2^n; for int (i=0; i<range;i++) printBinary(i); if you want to complicate things you may like to think of gray codes..don't give it a try for this question..:) Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Thu, Aug 12, 2010 at 2:00 PM, Raj N <rajn...@gmail.com> wrote: > Hi, > Can someone gimme the code to generate all possible bit strings of > length n recursively ? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > 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 algoge...@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.