~/lightning

Amortized O(1) Complexity in C++

Lightningat CppCon 2024 · on Sunday, 2024-09-15· [databases]
slides:none on file

Shows how amortized analysis works with concrete examples: uses the accounting method (coins) to analyze vector push_back, demonstrating amortized O(1) with a 3 coins budget per insertion despite occasional O(n) resizes. Examines std::ranges::begin on a filtered view and points out the standard relies on memoization so the first begin costs O(n) and later calls are O(1), making the standard's phrasing of amortized constant misleading when only a single call occurs.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.