69#if defined(_MSC_VER) && !defined(__clang__)
70# define MOVED_FROM_SKIP_LIST 0
72# define MOVED_FROM_SKIP_LIST 1
90 for (
size_t i = 0; i < n; ++i)
91 h.update(
static_cast<int>(i));
101 EXPECT_GT(
h.estimate(), 0.0);
110 for (
size_t i = 0; i < n; ++i)
111 s.
update(
static_cast<int>(i));
129 for (
size_t i = 0; i < n; ++i)
130 m.update(
static_cast<int>(i));
135 for (
size_t i = 0; i <
m.
size(); ++i)
136 if (
m.get_signature()[i] != std::numeric_limits<uint64_t>::max())
144 EXPECT_DOUBLE_EQ(
m.similarity(other), 1.0);
154 for (
size_t i = 0; i < n; ++i)
155 r.update(
static_cast<int>(i));
161 for (
int i = 0; i < 20; ++i)
163 EXPECT_EQ(
r.get_sample().size(),
r.sample_size());
172 for (
size_t i = 0; i < n; ++i)
179 for (
size_t i = 0; i < f.
size(); ++i)
212 for (
size_t i = 0; i < t.size(); ++i)
214 t.set(i,
static_cast<int>(i));
215 EXPECT_EQ(t.get(i),
static_cast<int>(i));
218 if (not t.is_empty())
219 (void) t.query(0, t.size() - 1);
220 EXPECT_EQ(t.values().size(), t.size());
238 if (not t.is_empty())
239 t.update(0, t.size() - 1, 2);
240 for (
size_t i = 0; i < t.size(); ++i)
242 t.set(i,
static_cast<int>(i));
243 t.point_update(i, 1);
244 EXPECT_EQ(t.get(i),
static_cast<int>(i) + 1);
246 if (not t.is_empty())
247 (void) t.query(0, t.size() - 1);
248 EXPECT_EQ(t.values().size(), t.size());
267 const size_t last = t.
size() - 1;
272 EXPECT_EQ(t.
query_sum(0, last), 3 *
static_cast<int>(t.
size()));
274 for (
size_t i = 0; i < t.
size(); ++i)
275 EXPECT_EQ(t.
get(i), 3);
287 for (
size_t i = 0; i < t.
size(); ++i)
288 EXPECT_EQ(t.get(i), 7);
291 EXPECT_EQ(t.query(0, t.
size() - 1), 7);
293 EXPECT_EQ(t.values().
size(), t.
size());
313 for (
size_t i = 0; i < t.
size(); ++i)
314 EXPECT_EQ(t.
get(i), 1);
317 EXPECT_EQ(t.
query(0, t.
size() - 1),
static_cast<int>(t.
size()));
329 for (
size_t i = 0; i < n; ++i)
330 a(i) =
static_cast<int>((i * 37 + 11) % 101);
344 for (
size_t i = 0; i < t.
size(); ++i)
369 EXPECT_EQ(
l.euler_tour().
size(),
l.euler_tour_size());
370 for (
size_t i = 0; i <
l.
size(); ++i)
372 EXPECT_LE(
l.depth_of(
l.lca(0, i)),
l.depth_of(i));
373 (void)
l.distance(0, i);
388 int least = std::numeric_limits<int>::max();
389 for (
size_t i = 0; i < q.
size(); ++i)
391 least = std::min(least, q.
get(i));
392 EXPECT_EQ(q.
query(0, i), least);
402 static Filter
make(
const size_t n)
404 Filter f(n < 10 ? 8 : n, 1);
405 for (
size_t i = 0; i < n; ++i)
406 (
void) f.insert(
static_cast<int>(i));
409 static bool is_empty(
const Filter & f) {
return f.is_empty(); }
410 static void use(Filter & f)
414 EXPECT_FALSE(f.contains(7));
415 EXPECT_FALSE(f.remove(7));
418 EXPECT_TRUE(
copy.insert(7));
419 EXPECT_TRUE(
copy.contains(7));
421 EXPECT_TRUE(f.insert(7));
422 EXPECT_TRUE(f.contains(7));
423 EXPECT_TRUE(f.remove(7));
425 EXPECT_TRUE(f.is_empty());
426 EXPECT_TRUE(f.insert(3));
427 EXPECT_TRUE(f.contains(3));
438 static Filter
make(
const size_t n)
440 Filter f(n < 10 ? 4 : 12, 8);
441 for (
size_t i = 0; i < n; ++i)
442 f.insert(
static_cast<int>(i));
445 static bool is_empty(
const Filter & f) {
return f.is_empty(); }
446 static void use(Filter & f)
450 EXPECT_FALSE(f.contains(7));
451 EXPECT_FALSE(f.remove(7));
453 Filter
copy(f), other(f.q(), f.r(), f.seed());
457 EXPECT_TRUE(f.contains(5));
458 EXPECT_TRUE(f.remove(5));
461 EXPECT_TRUE(f.contains(7));
462 EXPECT_TRUE(f.remove(7));
464 EXPECT_TRUE(f.is_empty());
466 EXPECT_TRUE(f.contains(3));
480 for (
size_t i = 0; i < n; ++i)
481 a.
push((i * 37 + 11) % 3 == 0);
487 const size_t n = a.
size();
490 EXPECT_EQ(a.
size(), n + 2);
494 EXPECT_EQ(a.
size(), n + 1);
504 for (
size_t i = 0; i < n; ++i)
505 (
void)
h.
insert(
static_cast<int>((i * 37 + 11) % 101));
513 EXPECT_EQ(
count,
h.size());
515 (void)
h.insert(500);
516 EXPECT_EQ(
h.top(), -1);
517 EXPECT_EQ(
h.getMin(), -1);
527 for (
size_t i = 0; i < n; ++i)
528 (
void) t.
insert(
static_cast<int>(i));
534 EXPECT_TRUE(t.verify());
535 EXPECT_EQ(t.keys().size(), t.size());
536 EXPECT_EQ(t.min_key().has_value(), not t.is_empty());
537 EXPECT_TRUE(t.
insert(-1));
539 EXPECT_EQ(t.min_key(), std::optional<int>(-1));
540 EXPECT_TRUE(t.
remove(-1));
541 EXPECT_TRUE(t.verify());
553 for (
size_t i = 0; i < n; ++i)
561 for (
size_t i = 0; i < v.
size(); ++i)
565 EXPECT_EQ(
w.size(), v.
size() + 1);
566 EXPECT_EQ(
w[v.
size()], 7);
569 EXPECT_EQ(v.
set(0, 9)[0], 9);
581 for (
size_t i = 0; i < n; ++i)
582 m =
m.
insert(
static_cast<int>(i),
static_cast<int>(i));
591 EXPECT_TRUE(
m.verify());
594 for (
size_t i = 0; i <
keys.size(); ++i)
596 m =
m.insert_or_assign(-1, 7);
597 ASSERT_NE(
m.
find(-1),
nullptr);
598 EXPECT_EQ(*
m.
find(-1), 7);
609 for (
size_t i = 0; i < n; ++i)
610 (
void)
l.
insert(
static_cast<int>(i));
619 EXPECT_NE(
l.
insert(-1),
nullptr);
620 EXPECT_NE(
l.
insert(-2),
nullptr);
621 EXPECT_TRUE(
l.has(-1));
625 EXPECT_NE(
l.
insert(5),
nullptr);
638 for (
size_t i = 0; i < n; ++i)
640 Node * p =
new Node(
static_cast<int>(i));
661 EXPECT_EQ(t.
insert(p), p);
662 EXPECT_EQ(t.
insert(q), q);
663 EXPECT_EQ(t.
search(-1), p);
665 EXPECT_EQ(removed, q);
685 for (
size_t i = 0; i < t.
size(); ++i)
707 static bool is_empty(
Tree & t) {
return t.getRoot() == Node::NullPtr; }
714 EXPECT_TRUE(t.verify());
716 EXPECT_TRUE(t.verify());
718 EXPECT_EQ(t.getRoot(), Node::NullPtr);
732 for (
size_t i = 0; i < n; ++i)
733 (
void) q.
append(
static_cast<int>(i));
745 const size_t before = q.
size();
747 EXPECT_EQ(q.
size(), before - 1);
754 void * pointer_cell(
const size_t i)
756 static int cells[1024];
766 for (
size_t i = 0; i < n; ++i)
795 for (
size_t i = 0; i < n; ++i)
796 t.
add_line(
static_cast<long>(i % 7) - 3,
static_cast<long>(i));
808 EXPECT_EQ(t.
query(7), -5000);
812 EXPECT_EQ(t.
query(3), 7);
821 for (
size_t i = 0; i < n; ++i)
823 const auto k =
static_cast<long>(i);
827 (void)
h.query_monotone(
static_cast<long>(2 * n));
833 if (not
h.is_empty())
835 EXPECT_EQ(
h.query_monotone(1000000),
h.query(1000000));
841 EXPECT_EQ(
h.query(0), 0);
842 EXPECT_EQ(
h.query_monotone(10), -5);
860 catch (
const std::out_of_range &)
868 for (uint64_t n = 0; ; ++n)
875 catch (
const std::out_of_range &)
879 EXPECT_EQ(
none, 1u) <<
"n = " << n;
880 EXPECT_EQ(
m.nCk(n, n), 1u) <<
"n = " << n;
883 EXPECT_EQ(
m.lucas_nCk(n, 1), n) <<
"n = " << n;
886 EXPECT_EQ(
m.nCk(3, 5), 0u);
909#if MOVED_FROM_SKIP_LIST
914 return std::numeric_limits<int>::max();
923 Skip_List::Node * new_skip_node(Skip_List &
l,
const int key)
925 const int level =
l.generateRandomLevel();
926 void * mem = ::operator
new(
sizeof(Skip_List::Node) +
sizeof(Skip_List::Node *) *
level);
927 return new (mem) Skip_List::Node(key, key,
level);
934 static Skip_List
make(
const size_t n)
937 for (
size_t i = 0; i < n; ++i)
938 (
void)
l.
insert(new_skip_node(
l,
static_cast<int>(i)));
941 static bool is_empty(
const Skip_List &
l) {
return not Skip_List::Iterator(
l).has_curr(); }
945 for (Skip_List::Iterator it(
l); it.has_curr(); it.next_ne())
947 for (
size_t i = 1; i <
nodes.size(); ++i)
948 EXPECT_LT(
nodes(i - 1)->get_key(),
nodes(i)->get_key());
949 Skip_List::Node * p =
l.
insert(new_skip_node(
l, -1));
950 EXPECT_EQ(
l.search(-1), p);
951 EXPECT_TRUE(
l.checkSkipList());
953 for (
size_t i = 0; i <
nodes.size(); ++i)
957 ::operator
delete(
nodes(i));
959 EXPECT_TRUE(is_empty(
l));
Classical DP optimization toolkit: D&C DP, Knuth, CHT, Li Chao, and monotone-queue transitions.
INSTANTIATE_TYPED_TEST_SUITE_P(traverses, Container, Ctypes)
WeightedDigraph::Node Node
Space-efficient bit array implementation.
Simple dynamic array with automatic resizing and functional operations.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
static Array create(const size_t n)
Create an array with n logical elements.
T & append(const T &data)
Append a copy of data
Contiguous array of bits.
int read_bit(const size_t i) const
Read bit i.
std::string get_bit_str() const
void pop()
Removes the last bit of the array.
void push(const unsigned int value)
Inserts the value at the end of the array.
constexpr size_t size() const noexcept
Returns the dimension of the bit array.
Memory-optimized Cuckoo Filter with bit-packed fingerprints.
Memory-optimized quotient filter with bit-packed slots.
Convex Hull Trick for minimum queries.
void add_line(const T slope, const T intercept)
Insert a new line; slopes must be non-increasing.
Count-Min Sketch frequency estimator.
CounterT estimate(const T &val) const
Estimate frequency of an element.
CounterT total_count() const noexcept
Sum of all event weights inserted so far.
void clear()
Clear all counters.
void update(const T &val, CounterT count=1)
Increment count for an element.
Industrial-grade Cuckoo Filter implementation.
Dynamic heap (priority queue) backed by DynArray.
T & insert(const T &key)
Insert a copy of key into the heap.
T & insert(const T &item)
T remove()
Remove the first item of the list.
void clear() noexcept
Empties the container.
size_t size() const noexcept
Return the number of items of the list, in constant time.
Dynamic ordered set implemented with a Skip List.
Generic linear hash table.
const size_t & size() const noexcept
Returns the number of elements in the table.
bool is_empty() const noexcept
return true is table is empty
Generic B+ Tree with configurable minimum degree.
Generic B-Tree with configurable minimum degree.
constexpr size_t size() const noexcept
Number of elements.
T get(const size_t i) const
Retrieve the value at position i in O(1).
Array< T > values() const
Copy of the original values.
T query(const size_t l, const size_t r) const
Range query over [l, r] in O(1).
size_t query_idx(const size_t l, const size_t r) const
Return the index of the optimal element in a[l..r].
constexpr bool is_empty() const noexcept
True if empty.
Array< size_t > inorder() const
Inorder traversal of the tree.
constexpr size_t root() const noexcept
Index of the root node.
Array< T > values() const
Copy of the original data array.
const T & data_at(const size_t i) const
Value at node i.
size_t left_child(const size_t i) const
Left child of node i.
bool is_leaf(const size_t i) const
True if node i is a leaf (no children).
constexpr size_t size() const noexcept
Number of nodes.
size_t parent_of(const size_t i) const
Parent of node i.
size_t right_child(const size_t i) const
Right child of node i.
constexpr bool is_empty() const noexcept
True if the tree is empty.
size_t height() const
Height of the tree (longest root-to-leaf path).
constexpr bool is_empty() const noexcept
True if the table contains no elements.
Array< T > values() const
Reconstruct all original values into an Array.
T get(const size_t i) const
Retrieve the value a[i] in O(1).
constexpr size_t num_levels() const noexcept
Number of precomputed levels.
T query(const size_t l, const size_t r) const
Range query over [l, r] in O(1).
constexpr size_t size() const noexcept
Number of logical elements.
constexpr bool is_empty() const noexcept
True if the tree contains no elements.
T prefix(size_t i) const
Prefix query: Plus(a[0], a[1], ..., a[i]).
void update(size_t i, const T &delta)
Point update: a[i] = Plus(a[i], delta).
constexpr size_t size() const noexcept
Number of logical elements.
bool is_empty() const noexcept
Return true if the tree is empty.
bool verify() const
Return true if this is a consistent randomized tree.
size_t size() const noexcept
Return the number of nodes that have the tree.
Node * select(const size_t i) const
Return the i-th node in inorder sense.
Node *& getRoot() noexcept
Return the tree's root.
constexpr bool is_empty() const noexcept
HyperLogLog cardinality estimator.
Li Chao tree for min line queries on an integral x-domain.
void add_line(const T slope, const T intercept)
bool is_empty() const noexcept
size_t node_count() const noexcept
MinHash signature generator.
High-performance combinatorics operations modulo a prime.
constexpr bool contains(const Key &key) const noexcept
Alias for has().
Immutable unordered map backed by a Hash Array Mapped Trie (HAMT).
Immutable vector backed by a 32-way bitmapped trie.
Array< T > to_array() const
Return all values in an Aleph array.
PersistentVector push_back(const T &value) const
Return a new version with value appended by copy.
const T & get(const size_t index) const
Read a value by index.
bool verify() const noexcept
Verify trie shape and logical prefix invariants.
PersistentVector set(const size_t index, const T &value) const
Return a new version with one index replaced by copy.
size_t size() const noexcept
Return the number of values in this version.
bool is_empty() const noexcept
Return true when the vector has no values.
PersistentVector pop_back() const
Return a new version without the last value.
Quotient filter for probabilistic set membership with deletion.
void put(const T &item)
Insert an item by copy.
void set_seed(unsigned long seed) const
Seeds the Mersenne Twister of the set, as gsl_rng_set() did: the positions are from then on those of ...
bool is_empty() const
Return true if the queue is empty.
T get()
Extract randomly an item.
T & append(const T &item)
Insert randomly an item by copy.
size_t size() const
Return the number of items in the queue.
Fenwick tree supporting range updates and range queries.
void update(size_t l, const size_t r, const T &delta)
Range update: add delta to every a[i] with l <= i <= r.
constexpr bool is_empty() const noexcept
True if the tree contains no elements.
constexpr size_t size() const noexcept
Number of logical elements.
T query(const size_t l, const size_t r) const
Range query: sum of a[l..r].
Incremental reservoir sampler (Algorithm R).
Ji Driver's Segment Tree (Segment Tree Beats).
void chmax(const size_t l, const size_t r, const T &v)
Range chmax: for each i in [l, r], set a[i] = max(a[i], v).
constexpr size_t size() const noexcept
Number of logical elements.
T query_sum(const size_t l, const size_t r) const
Range sum query over [l, r].
T get(const size_t i) const
Retrieve the value at position i.
T query_max(const size_t l, const size_t r) const
Range max query over [l, r].
void chmin(const size_t l, const size_t r, const T &v)
Range chmin: for each i in [l, r], set a[i] = min(a[i], v).
Array< T > values() const
Reconstruct all values into an Array.
T query_min(const size_t l, const size_t r) const
Range min query over [l, r].
constexpr bool is_empty() const noexcept
True if the tree contains no elements.
Skip List - a probabilistic ordered data structure.
void for_each(Operation &operation) const
Traverse all the container and performs an operation on each element.
The typed suite of the moved-from tests.
constexpr size_t size() const noexcept
Returns the number of entries in the table.
void clear()
Empties the container.
constexpr bool is_empty() const noexcept
Checks if the table is empty.
DynList< Key > keys() const
Returns a list containing all keys in the table.
Key * insert(const Key &key)
Inserts a key into the hash table (copy version).
Key & find(const Key &key)
Finds a key and returns a reference to it.
A dynamic table for managing void pointers with index recycling.
void * verify_pointer(long i, void *ptr) const
Verifies that a pointer matches the one stored at an index.
long frees() const noexcept
Returns the number of recyclable indices.
void remove_pointer(long i)
Removes the pointer at the given index.
bool is_empty() const noexcept
Checks if the table is empty.
long get_heap_index() const noexcept
Returns the current heap index (high water mark).
long insert_pointer(void *ptr)
Inserts a pointer and returns its assigned index.
void clear()
Clears all pointers from the table.
void * get_pointer(long i) const
Retrieves the pointer at the given index.
QuadTree - Hierarchical spatial index for 2D points.
void remove(const Point &p)
Remove a point from the tree.
Point * search(const Point &p) noexcept
Search for a point in the tree.
bool contains(const Point &p) const noexcept
Check if a point is within the tree's region.
Point * insert(Node *&r, const Point &p)
Recursive insert helper.
Memory-optimized Cuckoo filter with bit-packed fingerprints.
Memory-optimized quotient filter with bit-packed slots.
Count-Min Sketch for frequency estimation in streams.
Probabilistic set membership with Cuckoo filters.
DynArray< Graph::Node * > nodes
void destroyRec(Node *&root) noexcept
Free all the memory occupied by the tree root
size_t compute_cardinality_rec(Node *root) noexcept
Count the number of nodes of a binary tree.
HyperLogLog for approximate cardinality estimation.
LinearHashTable< int > Table
MinHash for estimating Jaccard similarity between sets.
Modular combinatorics utilities for computing binomial coefficients.
The pattern test of the moved-from objects.
::testing::Types< HyperLogLog< int >, Count_Min_Sketch< int >, MinHash< int >, Reservoir_Sampler< int >, Fenwick_Tree< int >, Range_Fenwick_Tree< int >, Sum_Segment_Tree< int >, Min_Segment_Tree< int >, Max_Segment_Tree< int >, Lazy_Sum_Segment_Tree< int >, Lazy_Min_Segment_Tree< int >, Lazy_Max_Segment_Tree< int >, Segment_Tree_Beats< int >, Sparse_Table< int >, Max_Sparse_Table< int >, Sum_Disjoint_Sparse_Table< int >, Cartesian_Tree< int >, Euler_Tour_LCA< int >, Cartesian_Tree_RMQ< int >, Cuckoo_Filter< int >, Compact_Cuckoo_Filter< int >, Quotient_Filter< int >, Compact_Quotient_Filter< int >, BitArray, DynArrayHeap< int >, B_Tree< int >, BPlus_Tree< int >, PersistentVector< int >, PersistentHashMap< int, int >, DynSkipList< int >, Rand_Tree< int >, Random_Set< int >, Treap< int >, Treap_Rk< int >, Pointer_Table, Li_Chao_Tree< long >, Convex_Hull_Trick< long >, ModularCombinatorics > Structures
void fill_or_free(Tree &t, const size_t n)
void insert_find_and_remove(Tree &t)
INSTANTIATE_TYPED_TEST_SUITE_P(Structures, MovedFrom, Structures)
Main namespace for Aleph-w library functions.
Itor2 copy(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg)
Copy elements from one range to another.
and
Check uniqueness with explicit hash + equality functors.
@ Tree
Basic arc (in spanning tree).
bool none(const Container &container, Operation &operation)
Return true if no element satisfies operation.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
Pointer table with index reuse for efficient pointer management.
Quotient filter: a cache-friendly probabilistic set with deletion.
Reservoir sampling for random selection from data streams.
Range minimum queries via Cartesian Tree.
Cartesian Tree for min-heap (range minimum).
LCA on a min-heap Cartesian Tree.
Fenwick tree for arithmetic types with find_kth support.
Lazy segment tree for range add + range max.
Lazy segment tree for range add + range min.
Lazy segment tree for range add + range sum.
Max Segment Tree for range maximum queries with point updates.
Sparse Table for range maximum queries.
Min Segment Tree for range minimum queries with point updates.
Randomized binary search tree.
Sparse Table for range minimum queries.
Disjoint Sparse Table for range sum queries.
Sum Segment Tree for range sum queries with point updates.
Extended treap (a special type of randomized binary search tree) which manages selection and splittin...
Treap (a special type of randomized binary search tree) using nodes without virtual destructor.
static bool is_empty(const Filter &f)
static void use(Filter &f)
static Filter make(const size_t n)
static bool is_empty(const Tree &t)
static Tree make(const size_t n)
static BitArray make(const size_t n)
static bool is_empty(const BitArray &a)
static void use(BitArray &a)
static bool is_empty(const Cartesian_Tree< int > &t)
static void use(Cartesian_Tree< int > &t)
static Cartesian_Tree< int > make(const size_t n)
static void use(Cartesian_Tree_RMQ< int > &q)
static bool is_empty(const Cartesian_Tree_RMQ< int > &q)
static Cartesian_Tree_RMQ< int > make(const size_t n)
static Convex_Hull_Trick< long > make(const size_t n)
static bool is_empty(const Convex_Hull_Trick< long > &h)
static void use(Convex_Hull_Trick< long > &h)
static bool is_empty(const Count_Min_Sketch< int > &s)
static void use(Count_Min_Sketch< int > &s)
static Count_Min_Sketch< int > make(const size_t n)
static DynArrayHeap< int > make(const size_t n)
static bool is_empty(const DynArrayHeap< int > &h)
static void use(DynArrayHeap< int > &h)
static void use(DynSkipList< int > &l)
static DynSkipList< int > make(const size_t n)
static bool is_empty(const DynSkipList< int > &l)
static bool is_empty(const Euler_Tour_LCA< int > &l)
static void use(Euler_Tour_LCA< int > &l)
static Euler_Tour_LCA< int > make(const size_t n)
static bool is_empty(const Fenwick_Tree< int > &f)
static Fenwick_Tree< int > make(const size_t n)
static void use(Fenwick_Tree< int > &f)
static bool is_empty(const HyperLogLog< int > &h)
static void use(HyperLogLog< int > &h)
static HyperLogLog< int > make(const size_t n)
static bool is_empty(const Li_Chao_Tree< long > &t)
static void use(Li_Chao_Tree< long > &t)
static Li_Chao_Tree< long > make(const size_t n)
static void use(MinHash< int > &m)
static bool is_empty(const MinHash< int > &m)
static MinHash< int > make(const size_t n)
static ModularCombinatorics make(const size_t n)
static bool is_empty(const ModularCombinatorics &m)
static void use(ModularCombinatorics &m)
static void use(PersistentHashMap< int, int > &m)
static PersistentHashMap< int, int > make(const size_t n)
static bool is_empty(const PersistentHashMap< int, int > &m)
static PersistentVector< int > make(const size_t n)
static void use(PersistentVector< int > &v)
static bool is_empty(const PersistentVector< int > &v)
static Pointer_Table make(const size_t n)
static bool is_empty(const Pointer_Table &t)
static void use(Pointer_Table &t)
Rand_Tree< int >::Node Node
static void use(Rand_Tree< int > &t)
static Rand_Tree< int > make(const size_t n)
static bool is_empty(const Rand_Tree< int > &t)
static Random_Set< int > make(const size_t n)
static bool is_empty(const Random_Set< int > &q)
static void use(Random_Set< int > &q)
static Range_Fenwick_Tree< int > make(const size_t n)
static bool is_empty(const Range_Fenwick_Tree< int > &f)
static void use(Range_Fenwick_Tree< int > &f)
static void use(Reservoir_Sampler< int > &r)
static bool is_empty(const Reservoir_Sampler< int > &r)
static Reservoir_Sampler< int > make(const size_t n)
static Segment_Tree_Beats< int > make(const size_t n)
static void use(Segment_Tree_Beats< int > &t)
static bool is_empty(const Segment_Tree_Beats< int > &t)
static bool is_empty(const Skip_List &l)
static void use(Skip_List &l)
static Skip_List make(const size_t n)
static Sum_Disjoint_Sparse_Table< int > make(const size_t n)
static bool is_empty(const Sum_Disjoint_Sparse_Table< int > &t)
static void use(Sum_Disjoint_Sparse_Table< int > &t)
How the moved-from tests build, check and use objects of a class.
static size_t fingerprint(const Tree &t)
static bool is_empty(Tree &t)
static Tree make(const size_t n)
static bool is_empty(const Tree &t)
static Tree make(const size_t n)
static Tree make(const size_t n)
static bool is_empty(const Tree &t)
static bool is_empty(const Filter &f)
static void use(Filter &f)
static Filter make(const size_t n)
static void use(Table &t)
static Table make(const size_t n)
static bool is_empty(const Table &t)
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
B-Tree implementation with configurable minimum degree.
B+ Tree implementation with linked leaves and configurable degree.
Cartesian Tree, LCA via Euler Tour, and RMQ via Cartesian Tree.
Disjoint Sparse Table for static range queries in O(1).
Array-based dynamic binary heap.
Dynamic ordered set implemented with a Skip List.
Fenwick tree (Binary Indexed Tree) for prefix queries.
Immutable path-copying hash map backed by a HAMT.
Immutable bitmapped-vector trie with structural sharing.
Randomized binary search tree.
Random access queue (bag) with O(1) random pop.
Segment trees for dynamic range queries with lazy propagation.
Skip list: probabilistic sorted linked structure.
Sparse Table for static range queries in O(1).
Treap with rank (order statistics).
Treap: randomized BST combining tree and heap properties.