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:
“The beginnings of altruism can be seen in children as early as the age of two. How then can we be so concerned that they count by the age of three, read by four, and walk with their hands across the overhead parallel bars by five, and not be concerned that they act with kindness to others?”
—Neil Kurshan (20th century)
“It is very important not to become hard. The artist must always have one skin too few in comparison to other people, so you feel the slightest wind.”
—Shusha Guppy (b. 1938)