English

Two Linear Passes Are Necessary for Sum-Exclude-Self Under Sublinear Space

Data Structures and Algorithms 2026-04-02 v1

Abstract

We prove that any algorithm computing the sum-exclude-self of an unsigned dd-bit integer array of length nn under sublinear space must perform two linear passes over the input. More precisely, the algorithm must read at least n1n-1 input elements before any output cell receives its final value, and at least nt/dn - \lfloor t/d \rfloor additional elements thereafter, where t=o(nd)t = o(nd) bits is the working memory size. This gives a total of 2n1t/d2n - 1 - \lfloor t/d \rfloor element reads. A trivial modification of the standard two-pass algorithm achieves this bound exactly for all practical input sizes. The proof uses this toy problem as a worked example to demonstrate the choke-point technique for proving sublinear-space lower bounds.

Keywords

Cite

@article{arxiv.2604.01012,
  title  = {Two Linear Passes Are Necessary for Sum-Exclude-Self Under Sublinear Space},
  author = {Andrew Au},
  journal= {arXiv preprint arXiv:2604.01012},
  year   = {2026}
}
R2 v1 2026-07-01T11:48:26.642Z