English

Top-K Color Queries for Document Retrieval

Data Structures and Algorithms 2010-10-19 v2 Information Retrieval

Abstract

In this paper we describe a new efficient (in fact optimal) data structure for the {\em top-KK color problem}. Each element of an array AA is assigned a color cc with priority p(c)p(c). For a query range [a,b][a,b] and a value KK, we have to report KK colors with the highest priorities among all colors that occur in A[a..b]A[a..b], sorted in reverse order by their priorities. We show that such queries can be answered in O(K)O(K) time using an O(Nlogσ)O(N\log \sigma) bits data structure, where NN 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.

Keywords

Cite

@article{arxiv.1007.1361,
  title  = {Top-K Color Queries for Document Retrieval},
  author = {Marek Karpinski and Yakov Nekrich},
  journal= {arXiv preprint arXiv:1007.1361},
  year   = {2010}
}
R2 v1 2026-06-21T15:45:57.286Z