docs: fix wrong examples and time/space claims#237
Merged
Conversation
4ff5d94 to
343e540
Compare
cameroncuster
commented
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full audit of every
@codeexample,@time/@spaceclaim, and semantic statement across all 136 library headers. Three parallel sweeps (data structures / math+graphs+convolution / trees+strings+monotonic_stack+dsu), each flagged item then hand-verified against the code before editing. Comment-only change; 0 code lines touched.Fixes (6 files):
data_structures_[l,r)/bit.hppwalk2returns min r s.t. sum of[0,r]>= sum[0,r+1)[l,r]twin's doc is already correct for its conventiongraphs/min_vertex_cover.hpp@time O(n + q * log n),@space O(n * \alpha(n))@time O(n + m),@space O(n)strings/.../compare_substrings.hppif cmp1<0 ...(x3)if cmp<0 ...cmp, notcmp1math/partitions.hppmath/num_distinct_subsequences.hppconvolution/min_plus_convolution...hppres[k]= min of(a[i]+b[j])(convex[j]+arbitrary[i])a,bthat don't exist; index order matches the code (convex[j],arbitrary[i],i+j==k)Flagged by the sweeps but verified correct, so NOT changed:
dijkstra.hppO(n + m log m)— correct for lazy-deletion Dijkstra (heap holds up to m entries; O(m log m) = O(m log n))mod_division.hppO(log(y))— Euclid on (y, mod) is O(log min(y, mod)) <= O(log y)linear_lca.hpp/linear_kth_par.hppO(n + q)— queries are O(1) given O(1) hardware bit ops (bit_floor/bit_width), which is the standard modelderangements.hppindexing — dp[1]=0 falls out of zero-init; matches A000166lcs_queries.hppO(nm log m + q log m + q log q)— the q log q term is real (per-row query sorts)Validation:
//!comment lines (checked mechanically)clang-format-22 --dry-run --Werror --style=file:.config/dev.clang-formatpasses on all 6 filesBased on
doc-contracts(#236) to avoid conflicts; if #236 merges first this rebases cleanly (no overlapping hunks).