Runnable samples
The repository ships runnable, self-contained sample projects for Bodu.Collections under
samples/Collections/. All
four samples are offline and deterministic - string-keyed scenarios supply a stable ordinal
comparer so that per-process string-hash randomization cannot vary the output - and are members
of bodu.slnx, built and executed by CI, so the code they show cannot drift from the current
API. Each sample's README documents every scenario individually: its intent, what the code does,
the output to expect, and the APIs demonstrated.
Run any sample from the repository root:
dotnet run --project samples/Collections/<SampleName>
The samples
Bodu.Collections.Samples.CollectionCatalogue
The general-purpose collections: CircularBuffer<T> (overwrite on
full) and Deque<T> with its overflow policy, the
EvictingDictionary<TKey, TValue> bounded cache with its eviction policies,
ItemEvicted order, and absolute and sliding TTL expiry, the MultiValueDictionary /
Multiset / OrderedSet / IndexedSet family, the BiDictionary forward/inverse map, the
NavigableSet / NavigableDictionary floor/ceiling/lower/higher navigation,
SequencedDictionary plus the update-priority IndexedPriorityQueue, the LayeredDictionary
and DefaultingDictionary decorators, and the sparse two-key Table with the append-only
SegmentedBuffer. Package: Bodu.Collections.
Bodu.Collections.Samples.RangesGraphsTrees
The structural collections: RangeSet / RangeDictionary coalescing and the IntervalTree
point-stab and overlap queries; the Graph<T> with GraphAlgorithms breadth-first search,
topological sort, and shortest path; DisjointSet<T> union-find connectivity; the Tree<T>,
Trie / Trie<TValue>, and RadixTrie prefix structures; and the AhoCorasickAutomaton
multi-pattern text scan. Package: Bodu.Collections.
Bodu.Collections.Samples.ProbabilisticSketches
The Bodu.Collections.Probabilistic approximate sketches over fixed inputs with a stable
comparer so the observed error is reproducible: BloomFilter<T> (no false negatives across the
added set, with one demonstrated false positive), CountMinSketch<T> (estimates never fall
below the true count), and HyperLogLog<T> (a distinct-count estimate reported against the true
cardinality and the ~1.04/√m standard error). Package: Bodu.Collections.
Bodu.Collections.Samples.BitSets
BitSet, the sole member of Bodu.Collections.Specialized:
bit addressing and half-open range mutation, the three size properties that routinely disagree
(Cardinality / Length / Capacity), the NextSetBit / NextClearBit scan primitives, and
the bulk set algebra with content-based equality. Package: Bodu.Collections.
Related
- Collections.Concurrent samples - the thread-safe variants.
- Core samples - the foundational library the collections build on.