A mode of a multiset is an element of maximum multiplicity; that is, occurs at least as frequently as any other element in . Given a list of items, we consider the problem of constructing a data structure that efficiently answers range mode queries on . Each query consists of an input pair of indices for which a mode of must be returned. We present an -space static data structure that supports range mode queries in time in the worst case, for any fixed . When , this corresponds to the first linear-space data structure to guarantee query time. We then describe three additional linear-space data structures that provide , , and query time, respectively, where denotes the number of distinct elements in and denotes the frequency of the mode of . Finally, we examine generalizing our data structures to higher dimensions.

生成讲解博客的中文版本

生成AI智能校验的中文版本