English

Tight Bounds for Online Stable Sorting

Data Structures and Algorithms 2009-07-07 v1

Abstract

Although many authors have considered how many ternary comparisons it takes to sort a multiset SS of size nn, the best known upper and lower bounds still differ by a term linear in nn. In this paper we restrict our attention to online stable sorting and prove upper and lower bounds that are within (o (n)) not only of each other but also of the best known upper bound for offline sorting. Specifically, we first prove that if the number of distinct elements (\sigma = o (n / \log n)), then ((H + 1) n + o (n)) comparisons are sufficient, where HH is the entropy of the distribution of the elements in SS. We then give a simple proof that ((H + 1) n - o (n)) comparisons are necessary in the worst case.

Keywords

Cite

@article{arxiv.0907.0741,
  title  = {Tight Bounds for Online Stable Sorting},
  author = {Travis Gagie and Yakov Nekrich},
  journal= {arXiv preprint arXiv:0907.0741},
  year   = {2009}
}
R2 v1 2026-06-21T13:21:22.449Z