You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root of the hashsplit tree is $N_{h^\prime,0}$
269
+
for the smallest value of $h^\prime$
270
+
such that $|N_{h^\prime}| = 1$
271
+
272
+
### Procedural description
273
+
274
+
For this description we use $N_h$ to denote a single node at height $h$.
275
+
The algorithm must keep track of the “rightmost” such node for each tier in the tree.
276
+
277
+
To compute a hashsplit tree from a byte sequence $X$,
194
278
compute its “root node” as follows.
195
279
196
-
1. Let $N_0$ be $(0, \langle\rangle)$ (i.e., a node at depth 0 with no children).
280
+
1. Let $N_0$ be $\langle\rangle$ (i.e., a node at height 0 with no children).
197
281
2. If $|X| = 0$, then:
198
-
a. Let $d$ be the largest depth such that $N_d$ exists.
199
-
b. If $|\operatorname{Children}(N_0)| > 0$, then:
200
-
i. For each integer $i$ in $[0 .. d]$, “close” $N_i$.
201
-
ii. Set $d \leftarrow d+1$.
202
-
c. [pruning] While $d > 0$ and $|\operatorname{Children}(N_d)| = 1$, set $d \leftarrow d-1$ (i.e., traverse from the prospective tree root downward until there is a node with more than one child).
203
-
d. **Terminate** with $N_d$ as the root node.
204
-
3. Otherwise, set $N_0 \leftarrow (0, \operatorname{Children}(N_0) \mathbin{\|} \langle P(X) \rangle)$ (i.e., add $P(X)$ to the list of children in $N_0$).
205
-
4. For each integer $i$ in $[0 .. L(X))$, “close” the node $N_i$ (see below).
206
-
5. Set $X \leftarrow R(X)$.
282
+
a. Let $h$ be the largest height such that $N_h$ exists.
283
+
b. If $|N_0| > 0$, then:
284
+
i. For each integer $i$ in $[0 .. h]$, “close” $N_i$ (see below).
285
+
ii. Set $h \leftarrow h+1$.
286
+
c. [pruning] While $h > 0$ and $|N_h| = 1$, set $h \leftarrow h-1$ (i.e., traverse from the prospective tree root downward until there is a node with more than one child).
287
+
d. **Terminate** with $N_h$ as the root node.
288
+
3. Otherwise, set $N_0 \leftarrow N_0 \mathbin{\|} \langle P_C(X) \rangle$ (i.e., add $P_C(X)$ to the list of children in $N_0$).
289
+
4. For each integer $i$ in $[0 .. L_C(X))$, “close” the node $N_i$ (see below).
290
+
5. Set $X \leftarrow R_C(X)$.
207
291
6. Go to step 2.
208
292
209
293
To “close” a node $N_i$:
210
294
211
-
1. If no $N_{i+1}$ exists yet, let $N_{i+1}$ be $(i+1, \langle\rangle)$ (i.e., a node at depth ${i + 1}$ with no children).
212
-
2. Set $N_{i+1} \leftarrow (i+1, \operatorname{Children}(N_{i+1}) \mathbin{\|} \langle N_i \rangle)$ (i.e., add $N_i$ as a child to $N_{i+1}$).
213
-
3. Let $N_i$ be $(i, \langle\rangle)$ (i.e., new node at depth $i$ with no children).
295
+
1. If no $N_{i+1}$ exists yet, let $N_{i+1}$ be $\langle\rangle$ (i.e., a node at height ${i + 1}$ with no children).
296
+
2. Set $N_{i+1} \leftarrow N_{i+1} \mathbin{\|} \langle N_i \rangle$ (i.e., add $N_i$ as a child to $N_{i+1}$).
297
+
3. Let $N_i$ be $\langle\rangle$ (i.e., new node at height $i$ with no children).
0 commit comments