计算机科学 > 数据结构与算法
[提交于 2010年10月18日 (v1),最后修订于 2010年10月18日 (此版本, v2)]
标题:Top-K Color Queries for Document Retrieval
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:In this paper we describe a new efficient (in fact optimal) data structure for the {\em top-$K$ color problem}. Each element of an array $A$ is assigned a color $c$ with priority $p(c)$. For a query range $[a,b]$ and a value $K$, we have to report $K$ colors with the highest priorities among all colors that occur in $A[a..b]$, sorted in reverse order by their priorities. We show that such queries can be answered in $O(K)$ time using an $O(N\log \sigma)$ bits data structure, where $N$ is the number of elements in the array and $\sigma$ is the number of colors. Thus our data structure is asymptotically optimal with respect to the worst-case query time and space. As an immediate application of our results, we obtain optimal time solutions for several document retrieval problems. The method of the paper could be also of independent interest.
提交历史
来自:Yakov Nekrich[v2] 2010年10月18日 星期一 10:58:22 UTC