Succinct Representation of Data Structures:Partial Sums.

Partial Sums

Let a1, a2,..., an be a sequence of n non-negative k-bit numbers. The partial sums problem maintains the sequence under the following operations:

image

Dietz [13] gave a structure for the partial sum problem that supports sum and update in O(lg n/ lg lg n) time using O(n lg n) bits of extra space, for the case when k = Θ(lg n) and no constraints on δ. The time bounds are optimal due to the lower bound of Fred man and Saks [20]. As the information-theoretic space lower bound is kn bits, this structure uses space within a constant factor of the optimal.

The main idea of this structure is to store the elements at the leaves of a complete tree with branching factor O(lgE n) for some E< 1. The operations are performed by traversing a path from a leaf to the root, querying/updating the nodes along the path.

The searchable partial sums problem is an extension of the partial sums problem that also supports the following operation:

• search(j): find the smallest i such that sum(i) j.

When k = 1 (i.e., each element is a bit), the special case is commonly known as the dynamic bit vector problem, which maintains a bit vector of length n under rank, select and flip (update) operations.

For the searchable partial sums problem there is a structure that supports all operations in O(lg n/ lg lg n) time, and uses kn + o(kn) bits of space [49]. For k = O(lg lg n), one can also obtain a structure that again takes kn + o(kn) bits and supports sum and search in O(logb n) time and update in O(b) amortized time, for any parameter b lg n/ lg lg n [30].

For the partial sums problem, one can support the above trade-off for k = O(lg n) [49], and the time bounds can be shown to be optimal [20].

For the dynamic bit vector problem, one can support rank and select in O(logb n) time and flip in O(b) (worst-case) time, for any parameter lg n/ lg lg n b n, using o(n) bits of extra space. One can also extend the above trade-off for k = O(lg lg n), using kn + o(kn) bits of space.

See [49] and [30] for details.

Comments

Popular posts from this blog

0/1 Knapsack Problem Memory function.

Binary Space Partitioning Trees:BSP Tree as a Hierarchy of Regions.

Drawing Trees:HV-Layout