阅读背景:

0和1的数组组合

来源:互联网 

What is a good algorithm to fill an array with 0s and 1s combinations. For example if I have three columns the combinations would be: (1 1 1) (0 1 1) (1 0 1) (0 0 1) (1 1 0) (0 1 0) (1 0 0) (0 0 0) It makes a total of 8 rows (I hope I'm right here). So how to determine the needed number of rows in advance (depending on the N number of columns) and then how to fill the array out programatically? Any programming language is fine (I tagged C and lisp because of familiarity) it's the algorithm that is needed. ThanksWhat is a good algorithm to fill an array with




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: