if im not an error, let e = element
replace each set A, B with true if e is in the set, false if it is not. Then convert the set operators to their logical equivalents and evaluate the expression as logical. It should display logical operators well, even xor and more.
for example, if e is in both AB, but not D
C = (A U B) xor D
he will be in C because
C = (true or true) xor false
-> (true) xor false
-> true
This can be pretty fast if you can quickly find if an item is in a set
source
share