in reply to Better algorithm or data structure?

If your boolean sets are of pre-determined size then you could improve performance by converting to binary number, with each bit representing a boolean. Then testing for all truth or all false is a simple matter of an and conditional.
Another way to expedite the process is to do with the order of the boolean set, if particular booleans are more likely to be false than others. Therefore check these at earliest in the loop conditional and exit the loop as soon as false encountered. A related solution may also be possible by somehow using AND between all parts of the boolean set, with the short-circuiting behavior of leftmost False leaving the compound conditional early.
the hardest line to type correctly is: stty erase ^H
  • Comment on Re: Better algorithm or data structure?