English

Counting Inversions Adaptively

Data Structures and Algorithms 2015-03-05 v1

Abstract

We give a simple and efficient algorithm for adaptively counting inversions in a sequence of nn integers. Our algorithm runs in O(n+nlg(Inv/n))O(n + n \sqrt{\lg{(Inv/n)}}) time in the word-RAM model of computation, where InvInv is the number of inversions.

Keywords

Cite

@article{arxiv.1503.01192,
  title  = {Counting Inversions Adaptively},
  author = {Amr Elmasry},
  journal= {arXiv preprint arXiv:1503.01192},
  year   = {2015}
}

Comments

5 pages

R2 v1 2026-06-22T08:43:49.812Z