Given two sets, each containing integer values, how could one find a set containing all possible pair-wise ORs
of the values of those two sets? E.g. (all numbers ar
Although I don't know much about it, I wonder if, depending on the cardinality of the data, using a trie for one set could improve efficiency. When traversing the other set to or
with the indexed set, whole branches of the tree may be skipped if it can be determined that bits are matched for the current integer in the indexed set.
Another optimization could be to skip all pairings of bit-length n if we already have 2^(n-1) results of that length; for example, there are eight possible integers, four bits in length.