in reply to Need a faster way to find matches
The following tests the LSB of a variable: $value & 1
Updated Update: Actually I was wrong: The number of permutations of subsets k drawn from a set of size n is n!/(n-k)! only, or in this case 2000! / 1998! or 2 000 * 1 999 = 3 998 000. Still a big number, but doable.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need a faster way to find matches
by remzak (Acolyte) on Jan 17, 2010 at 16:21 UTC | |
by kikuchiyo (Hermit) on Jan 17, 2010 at 17:18 UTC | |
by remzak (Acolyte) on Jan 17, 2010 at 18:19 UTC | |
by kikuchiyo (Hermit) on Jan 17, 2010 at 19:17 UTC | |
by remzak (Acolyte) on Jan 18, 2010 at 00:25 UTC | |
|