while reading a chapter on basic operations on sets from a book of data structures using aho, I came across the next line in the bitwise vector implementation of sets of sets ...
if the universal set is sufficiently small so that a bit vector fits in one computer word, then union, intersection and difference can be performed by single logical operations in the language of the underlying machine..
the bit-vector implementation of sets implies that a set is denoted by an array, whose indices denote the elements of the set, and the contents of the index are one if it is a member of the array and zero if not .... therefore, operations with elements, insertion and deletion can be performed during constant time ... but can anyone show me how intersection, union and difference can be performed by single logical operations, as indicated in the excerpt ... plz give an example (or code) for any of the three operations ....
source share