Counting through all binary numbers with equal 1's and 0's

Posted by Stuart on Stack Overflow See other posts from Stack Overflow or by Stuart
Published on 2010-04-14T05:06:31Z Indexed on 2010/04/14 5:13 UTC
Read the original article Hit count: 291

Filed under:
|

I'm implementing a binary representation of an equal-side bi-partitioning algorithm and I'm wondering what the best way to iterate through all combinations of N bits that have equal (N/2) 1's and 0's. I'm trying to find the quickest way, not the easiest to code. Thanks.

© Stack Overflow or respective owner

Related posts about partitioning

Related posts about combinations