Parallel Comparison
The purpose of the compression achieved by sketching is to allow all of the keys to be stored in one w-bit word. Let the node sketch of a node be the bit string
- 1
sketch
(x1)1sketch
(x2)...1sketch
(xk)
We can assume that the sketch function uses exactly b ≤ r4 bits. Then each block uses 1 + b ≤ w4/5 bits, and since k ≤ w1/5, the total number of bits in the node sketch is at most w.
A brief notational aside: for a bit string s and nonnegative integer m, let sm denote the concatenation of s to itself m times. If t is also a bit string st denotes the concatenation of t to s.
The node sketch makes it possible to search the keys for any b-bit integer y. Let z = (0y)k, which can be computed in constant time (multiply y by the constant (0b1)k). Note that 1sketch
(xi) - 0y is always positive, but preserves its leading 1 iff sketch
(xi) ≥ y. We can thus compute the smallest index i such that sketch
(xi) ≥ y as follows:
- Subtract z from the node sketch.
- Take the bitwise AND of the difference and the constant (10b)k. This clears all but the leading bit of each block.
- Find the most significant bit of the result.
- Compute i, using the fact that the leading bit of the i-th block has index i(b+1).
Read more about this topic: Fusion Tree
Famous quotes containing the words parallel and/or comparison:
“We tend to be so bombarded with information, and we move so quickly, that theres a tendency to treat everything on the surface level and process things quickly. This is antithetical to the kind of openness and perception you have to have to be receptive to poetry. ... poetry seems to exist in a parallel universe outside daily life in America.”
—Rita Dove (b. 1952)
“It is comparison than makes people miserable.”
—Chinese proverb.