We consider the problem of encoding two-dimensional arrays, whose elements come from a total order, for answering \topk{} queries. The aim is to obtain encodings that use space close to the information-theoretic lower bound, which can be constructed efficiently. For an $m \times n$ array, with $m \le n$, we first propose an encoding for answering 1-sided \topk{} queries, whose query range is restricted to $[1 \dots m][1 \dots a]$, for $1 \le a \le n$. Next, we propose an encoding for answering for the general (4-sided) \topk{} queries that takes $(m\lg{{(k+1)n \choose n}}+2nm(m-1)+o(n))$ bits, which generalizes the \textit{joint Cartesian tree} of Golin et al. [TCS 2016]. Compared with trivial $O(nm\lg{n})$-bit encoding, our encoding takes less space when $m = o(\lg{n})$. In addition to the upper bound results for the encodings, we also give lower bounds on encodings for answering $1$ and $4$-sided \topk{} queries, which show that our upper bound results are almost optimal.
翻译:我们考虑的是二维阵列的编码问题, 其元素来自总顺序, 用于回答 $1\le a\le n$。 接下来, 我们提出一个使用接近信息- 理论下界空间的编码, 可以高效构建。 对于一个$m\ timen n$的阵列, 使用$m\ timen n$\ le n$, 我们首先提出一个用于回答一面问询的编码, 其查询范围限制在$1\ dots m [1\ dots a]$, 以1\le a\le n$。 接下来, 我们提出一个使用接近信息- 理论下界的空格调的编码。 对于一个$( m\ lg+1)\\\ knn n$, 我们的下调调调的编码需要$( m\ lg\ k+1) nchoose n2nm(m-1)+o(n) bits, 用来概括 Gollin et al. [TCS etto] 。 的查询范围 。 。 。 与微值 $(n\ lg) adcreg) codealends res res lappres lapprodudeal res res res res res endal $lus endal res res ends $lus $lus endal endal res.