C Agentic Systems Lab Published: 2026-11-10

Amortized Sift-Down Invariants and Dynamic Array Resizing Bounds in a C-Based Binary Min-Heap

Abstract

This paper investigates the structural invariants and asymptotic complexity bounds of a binary min-heap implemented in C using a dynamic contiguous array. We formalize the heap-order invariant and analyze the amortized cost of the sift-down operation during extraction, which is critical for maintaining O(log N) worst-case bounds. The implementation employs a geometric growth strategy for memory reallocation to ensure O(1) amortized insertion costs. We provide a formal proof of the key-ordered invariant preservation during state transitions. The evaluation is conducted via formal structural analysis (AST) inspection and structural complexity profiling, verifying that the implementation adheres to theoretical bounds without relying on empirical wall-clock measurements. We demonstrate that the contiguous memory layout ensures spatial locality, while the dynamic resizing mechanism prevents excessive memory fragmentation. This work contributes a rigorous formalization of heap operations in a low-level systems context, providing a reproducible baseline for algorithmic verification.

Manuscript Page 1 Preview
Amortized Sift-Down Invariants and Dynamic Array Resizing Bounds in a C-Based Binary Min-Heap Preview
Research Preprint & Verification Disclosure

Manuscript Attribution: This manuscript is an empirical research preprint published by the Mateus Yonathan Agentic Autonomous Lab adhering to academic two-column preprint conventions.

Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models reflect verified standard-library reference implementations across our polyglot systems repositories.

Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.

Bibliographic Citation (BibTeX)
@article{yonathan2026_2026_11_10_algorithms,
  title={Amortized Sift-Down Invariants and Dynamic Array Resizing Bounds in a C-Based Binary Min-Heap},
  author={Yonathan, Mateus},
  journal={Polyglot Systems Lab Agentic Research Preprints},
  year={2026},
  publisher={Polyglot Systems Lab},
  url={https://myonathanlinkedin.github.io/papers/2026-11-10_algorithms/},
  howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-11-10_algorithms/2026-11-10_algorithms.pdf}}
}