A near optimal data structure for a type of range query problem

  • Authors:
  • Michael L. Fredman

  • Affiliations:
  • -

  • Venue:
  • STOC '79 Proceedings of the eleventh annual ACM symposium on Theory of computing
  • Year:
  • 1979

Quantified Score

Hi-index 0.02

Visualization

Abstract

Let G denote the set of elements of a commutative group whose addition operations is denoted by +, let N be a positive integer, and let A(1) ,..., A(N) denote an array with values in G. We will be concerned with designing data structures for representing the array A, which facilitate efficient implementation of the following two on-line tasks: (1) Update(j,x); replace A(j) by A(j) +x. (j and x are inputs, 1≤j≤N and x&egr;G) (2) Retrieve(j); returns the value of A(1) +...+ A(j). (j is an input, 1≤j≤N) As a motivating example, let G be the group of integers with + denoting the usual addition operation. Imagine a standardized examination given to large numbers of individuals over an indefinite period of time. Assume that each examinee will attain an integer score in the interval [1,N]. If an individual gets j points, this fact is recorded by executing Update(j,1). so that A(j) represents the number of individuals to date having scored j points. In order to compute the percentile currently associated with a particular score k, we need the cumulative sum provided by executing Retrieve(k).