competitive/data_structure/
mod.rs1use crate::algebra::{
4 AbelianGroup, AbelianMonoid, AdditiveOperation, Associative, EmptyAct, Group, LazyMapMonoid,
5 Magma, MaxOperation, MinOperation, Monoid, MonoidAct, SemiGroup, Unital,
6};
7use crate::algorithm::{BitDpExt, SliceBisectExt};
8use crate::num::{Bounded, RangeBoundsExt};
9use crate::tools::{Comparator, Xorshift, comparator};
10
11#[codesnip::entry("Accumulate")]
12pub use self::accumulate::{Accumulate, Accumulate2d, AccumulateKd};
13#[codesnip::entry("Allocator")]
14pub use self::allocator::{Allocator, BoxAllocator, MemoryPool};
15#[codesnip::entry("BinaryIndexedTree")]
16pub use self::binary_indexed_tree::BinaryIndexedTree;
17#[codesnip::entry("BinaryIndexedTree2D")]
18pub use self::binary_indexed_tree_2d::BinaryIndexedTree2D;
19#[codesnip::entry("BitVector")]
20pub use self::bit_vector::{BitVector, RankSelectDictionaries};
21#[codesnip::entry("BitSet")]
22pub use self::bitset::BitSet;
23#[codesnip::entry("compress")]
24pub use self::compress::{Compressor, HashCompress, VecCompress};
25#[codesnip::entry("CompressedBinaryIndexedTree")]
26pub use self::compressed_binary_indexed_tree::{
27 CompressedBinaryIndexedTree, CompressedBinaryIndexedTree1d, CompressedBinaryIndexedTree2d,
28 CompressedBinaryIndexedTree3d, CompressedBinaryIndexedTree4d,
29};
30#[codesnip::entry("CompressedSegmentTree")]
31pub use self::compressed_segment_tree::{
32 CompressedSegmentTree, CompressedSegmentTree1d, CompressedSegmentTree2d,
33 CompressedSegmentTree3d, CompressedSegmentTree4d,
34};
35#[codesnip::entry("container")]
36pub use self::container::{
37 BTreeMapFactory, Container, ContainerEntry, ContainerFactory, HashMapFactory,
38 HashMapFactoryWithCapacity,
39};
40#[codesnip::entry("Counter")]
41pub use self::counter::{BTreeCounter, HashCounter};
42#[codesnip::entry("DisjointSparseTable")]
43pub use self::disjoint_sparse_table::DisjointSparseTable;
44#[codesnip::entry("FibonacciHash")]
45pub use self::fibonacci_hash::{
46 FibHashMap, FibHashSet, FibonacciHasher, FibonacciHasheru32, FibonacciHasheru64,
47};
48#[codesnip::entry("Static2DTree")]
49pub use self::kdtree::Static2DTree;
50#[codesnip::entry("LazySegmentTree")]
51pub use self::lazy_segment_tree::LazySegmentTree;
52#[codesnip::entry("LazySegmentTreeMap")]
53pub use self::lazy_segment_tree_map::LazySegmentTreeMap;
54#[codesnip::entry("LineSet")]
55pub use self::line_set::LineSet;
56#[codesnip::entry("PairingHeap")]
57pub use self::pairing_heap::PairingHeap;
58#[codesnip::entry("PartiallyRetroactivePriorityQueue")]
59pub use self::partially_retroactive_priority_queue::PartiallyRetroactivePriorityQueue;
60#[codesnip::entry("PersistentSegmentTree")]
61pub use self::persistent_segment_tree::PersistentSegmentTree;
62#[codesnip::entry("RangeArithmeticProgressionAdd")]
63pub use self::range_ap_add::RangeArithmeticProgressionAdd;
64#[codesnip::entry("RangeFrequency")]
65pub use self::range_frequency::RangeFrequency;
66#[codesnip::entry("RangeMap")]
67pub use self::range_map::{RangeMap, RangeSet};
68#[codesnip::entry("RangeMinimumQuery")]
69pub use self::range_minimum_query::RangeMinimumQuery;
70#[codesnip::entry("SegmentTree")]
71pub use self::segment_tree::SegmentTree;
72#[codesnip::entry("SegmentTreeMap")]
73pub use self::segment_tree_map::SegmentTreeMap;
74#[codesnip::entry("sliding_window_aggregation")]
75pub use self::sliding_window_aggregation::{DequeAggregation, QueueAggregation};
76#[codesnip::entry("slope_trick")]
77pub use self::slope_trick::SlopeTrick;
78#[codesnip::entry("SparseSet")]
79pub use self::sparse_set::SparseSet;
80#[codesnip::entry("SplayTree")]
81pub use self::splay_tree::{SplayMap, SplaySequence};
82#[codesnip::entry("SubmaskRangeQuery")]
83pub use self::submask_range_query::SubmaskRangeQuery;
84#[codesnip::entry("transducer")]
85pub use self::transducer::*;
86#[codesnip::entry("Treap")]
87pub use self::treap::{Treap, TreapData};
88#[codesnip::entry("Trie")]
89pub use self::trie::Trie;
90#[codesnip::entry("UnionFind")]
91pub use self::union_find::{
92 MergingUnionFind, PotentializedUnionFind, UndoableUnionFind, UnionFind, UnionFindBase,
93};
94#[codesnip::entry("VecMap")]
95pub use self::vec_map::{FixedVecMapFactory, VecMap, VecMapFactory, VecMapFactoryWithCapacity};
96#[codesnip::entry("WaveletMatrix")]
97pub use self::wavelet_matrix::WaveletMatrix;
98
99#[cfg_attr(
100 nightly,
101 codesnip::entry("Accumulate", include("algebra", "discrete_steps"))
102)]
103mod accumulate;
104#[cfg_attr(nightly, codesnip::entry("Allocator"))]
105mod allocator;
106#[cfg_attr(nightly, codesnip::entry("BinaryIndexedTree", include("algebra")))]
107mod binary_indexed_tree;
108#[cfg_attr(nightly, codesnip::entry("BinaryIndexedTree2D", include("algebra")))]
109mod binary_indexed_tree_2d;
110#[cfg_attr(
111 nightly,
112 codesnip::entry("binary_search_tree", include("Allocator", "LazyMapMonoid"))
113)]
114pub mod binary_search_tree;
115#[cfg_attr(nightly, codesnip::entry("BitVector"))]
116mod bit_vector;
117#[cfg_attr(nightly, codesnip::entry("BitSet"))]
118mod bitset;
119#[cfg_attr(nightly, codesnip::entry("compress", include("binary_search")))]
120mod compress;
121#[cfg_attr(
122 nightly,
123 codesnip::entry("CompressedBinaryIndexedTree", include("algebra", "binary_search"))
124)]
125mod compressed_binary_indexed_tree;
126#[cfg_attr(
127 nightly,
128 codesnip::entry("CompressedSegmentTree", include("algebra", "binary_search"))
129)]
130mod compressed_segment_tree;
131#[cfg_attr(nightly, codesnip::entry("container"))]
132mod container;
133#[cfg_attr(nightly, codesnip::entry("Counter"))]
134mod counter;
135#[cfg_attr(nightly, codesnip::entry("DisjointSparseTable", include("algebra")))]
136mod disjoint_sparse_table;
137#[cfg_attr(nightly, codesnip::entry("FibonacciHash"))]
138mod fibonacci_hash;
139#[cfg_attr(nightly, codesnip::entry("Static2DTree"))]
140mod kdtree;
141#[cfg_attr(
142 nightly,
143 codesnip::entry("LazySegmentTree", include("LazyMapMonoid", "discrete_steps"))
144)]
145mod lazy_segment_tree;
146#[cfg_attr(
147 nightly,
148 codesnip::entry("LazySegmentTreeMap", include("LazyMapMonoid", "discrete_steps"))
149)]
150mod lazy_segment_tree_map;
151#[cfg_attr(nightly, codesnip::entry("LineSet", include("bounded")))]
152mod line_set;
153#[cfg_attr(
154 nightly,
155 codesnip::entry("PairingHeap", include("Comparator", "MonoidAct"))
156)]
157mod pairing_heap;
158#[cfg_attr(
159 nightly,
160 codesnip::entry(
161 "PartiallyRetroactivePriorityQueue",
162 include("bounded", "SegmentTree", "MaxOperation", "MinOperation")
163 )
164)]
165pub mod partially_retroactive_priority_queue;
166#[cfg_attr(
167 nightly,
168 codesnip::entry(
169 "PersistentSegmentTree",
170 include("Allocator", "algebra", "discrete_steps")
171 )
172)]
173mod persistent_segment_tree;
174#[cfg_attr(nightly, codesnip::entry("RangeArithmeticProgressionAdd"))]
175mod range_ap_add;
176#[cfg_attr(
177 nightly,
178 codesnip::entry("RangeFrequency", include("BinaryIndexedTree", "AdditiveOperation"))
179)]
180mod range_frequency;
181#[cfg_attr(nightly, codesnip::entry("RangeMap"))]
182mod range_map;
183#[cfg_attr(nightly, codesnip::entry("RangeMinimumQuery"))]
184mod range_minimum_query;
185#[cfg_attr(
186 nightly,
187 codesnip::entry("SegmentTree", include("algebra", "discrete_steps"))
188)]
189mod segment_tree;
190#[cfg_attr(
191 nightly,
192 codesnip::entry("SegmentTreeMap", include("algebra", "discrete_steps"))
193)]
194mod segment_tree_map;
195#[cfg_attr(
196 nightly,
197 codesnip::entry("sliding_window_aggregation", include("algebra"))
198)]
199mod sliding_window_aggregation;
200#[cfg_attr(nightly, codesnip::entry("slope_trick"))]
201mod slope_trick;
202#[cfg_attr(nightly, codesnip::entry("SparseSet"))]
203mod sparse_set;
204#[cfg_attr(
205 nightly,
206 codesnip::entry("SplayTree", include("Allocator", "LazyMapMonoid"))
207)]
208pub mod splay_tree;
209#[cfg_attr(
210 nightly,
211 codesnip::entry("SubmaskRangeQuery", include("algebra", "BitDp", "Xorshift"))
212)]
213pub mod submask_range_query;
214#[cfg_attr(
215 nightly,
216 codesnip::entry(
217 "transducer",
218 include("algebra", "container", "VecMap", "digit_sequence")
219 )
220)]
221mod transducer;
222#[cfg_attr(
223 nightly,
224 codesnip::entry("Treap", include("binary_search_tree", "Xorshift"))
225)]
226pub mod treap;
227#[cfg_attr(nightly, codesnip::entry("Trie", include("algebra")))]
228mod trie;
229#[cfg_attr(
230 nightly,
231 codesnip::entry("UnionFind", include("algebra", "TupleOperation"))
232)]
233pub mod union_find;
234#[cfg_attr(nightly, codesnip::entry("VecMap", include("container")))]
235mod vec_map;
236#[cfg_attr(
237 nightly,
238 codesnip::entry("WaveletMatrix", include("BitVector", "compress", "algebra"))
239)]
240mod wavelet_matrix;