Counting inversions in lists

  • Authors:
  • Anupam Gupta;Francis X. Zane

  • Affiliations:
  • Lucent Bell Labs, Murray Hill NJ;Lucent Bell Labs, Murray Hill NJ

  • Venue:
  • SODA '03 Proceedings of the fourteenth annual ACM-SIAM symposium on Discrete algorithms
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

In a recent paper, Ajtai et al. [1] give a streaming algorithm to count the number of inversions in a stream Lε[m]n using two passes and O(ε−1-√n log n(log m + log n)) space. Here, we present a simple randomized streaming algorithm for the same problem that uses one pass and O(ε−3 log2 n log m) space. Our algorithm is based on estimating quantiles of the items already seen in the stream, and using that to estimate the number of inversions involving each element.