Tree Path Majority Data Structures

06/05/2018
by   Travis Gagie, et al.
0

We present the first solution to τ-majorities on tree paths. Given a tree of n nodes, each with a label from [1..σ], and a fixed threshold 0<τ<1, such a query gives two nodes u and v and asks for all the labels that appear more than τ· |P_uv| times in the path P_uv from u to v. Note that the answer to any query is of size up to 1/τ. On a w-bit RAM machine, we obtain a linear-space data structure that lists all the majorities in time O((1/τ)^* n _w σ). For any κ > 1, we can also build a data structure that uses O(n^[κ] n) space, where ^[κ] n is the iterated logarithm, and answers queries in time O((1/τ)_w σ). The construction time of both data structures is O(n n). We also describe succinct-space solutions, both reaching the same query time of the linear-space structure. One uses 2nH + 4n + o(n)(H+1) bits, where H <σ is the entropy of the distribution of labels in T, and can be built in O(n n) time. The other uses nH + O(n) + o(nH) bits and is built in O(n n) randomized time.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset