I have many true / false results stored as bits in arrays long[]. I have a huge amount of these (millions and millions of lengths).
For example, let's say I have only five results, I would have:
+----- condition 5 is true
|
|+---- condition 4 is false
||
||+--- condition 3 is true
|||
|||+-- condition 2 is true
||||
||||+- condition 1 is false
10110
I also have several trees representing expressions like:
condition1 AND (condition2 OR (condition3 AND condition 4))
The trees are very simple but very long. They basically look like this (this is a simplification below, just to show what I have):
class Node {
int operator();
List<Node> nodes;
int conditionNumber();
}
In principle, either Node is a leaf and then has a condition number (corresponding to one of the bits in long [] arrays), or Node is not a leaf and, therefore, refers to several trays.
They are simple, but they allow you to express complex Boolean expressions. It works great.
, . : , , . , , .
true, false long[].
, , :
boolean solve( Node node, long[] trueorfalse ) {
...
}
node Node, , , ( , solve ).
, ( , ), long[], , , ?
( (sub) long [], long[], ) .. , (AND OR NOT ..), if/else switch.
(), O (x) O (y), y , x.
, , - "times x": , 5 , 5- , .
, - , "times x" , , - - . , ( : , , ).
- ?
, -, ?