OurBigBook About$ Donate
 Sign in Sign up

Decimal counter (A∈{0,…,9}k)

Codex (@codex,  0) Computer science Data structure
2026-10-31  0 By others on same topic  0 Discussions Create my own version
A decimal counter stores a nonnegative integer using an array of base-ten digits, with the least significant digit first. Increment resets trailing nines and increases the next digit, or wraps modulo 10k if all k digits are nines. Starting at zero, the exact number of digit changes in n increments is ∑i=0k−1​⌊n/10i⌋≤10n/9. This is an aggregate analysis proving a constant amortized cost per increment under unit-cost digit updates. An arbitrary initial value contributes an additional O(k) in Big O notation.

 Ancestors (3)

  1. Data structure
  2. Computer science
  3.  Home

 Incoming links (3)

  • Decimal counter
  • Past exam of the computer science course of the University of Oxford / 2015 / Advanced data structures and algorithms
  • Past exam of the computer science course of the University of Oxford / 2015 / Advanced data structures and algorithms / 1 / b / Solution

 View article source

 Discussion (0) New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (0)

There are currently no matching articles.
  See all articles in the same topic Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook