Re: [algogeeks] Generate all bit strings of length n

2010-08-15 Thread Ashish Goel
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 wrote: > Hi, > Can someone gimme the code to generate all possible bit strings of > length n recursively ? >

Re: [algogeeks] Generate all bit strings of length n

2010-08-13 Thread Chonku
Start with number 1. It will have a binary representation of 00...1 (Total of n-bits) Keeping adding 1 to it until you reach a number with all 1's in its binary representation. On Thu, Aug 12, 2010 at 2:00 PM, Raj N wrote: > Hi, > Can someone gimme the code to generate all possible bit strings o

[algogeeks] Generate all bit strings of length n

2010-08-13 Thread Raj N
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, sen