79 Node * black(
const int key,
Node *
l =
nullptr,
Node *
r =
nullptr)
81 Node * p = node(key,
l,
r);
88 Node * p = node(key,
l,
r);
93 Node * with_priority(
const unsigned long priority,
const int key,
96 Node * p = node(key,
l,
r);
97 p->getPriority() = priority;
103 template <
class Node>
104 size_t set_counters(
Node * p)
noexcept
106 if (p == Node::NullPtr)
108 const size_t n = set_counters(
LLINK(p)) + set_counters(
RLINK(p)) + 1;
114 template <
class Node>
115 int set_balance_factors(
Node * p)
noexcept
117 if (p == Node::NullPtr)
119 const int hl = set_balance_factors(
LLINK(p));
120 const int hr = set_balance_factors(
RLINK(p));
121 DIFF(p) =
static_cast<signed char>(
hr - hl);
122 return 1 + (hl >
hr ? hl :
hr);
126 template <
class Node>
129 if constexpr (Counted_Node<Node>)
135 template <
class Tree>
139 tree.getRoot() =
root;
140 const bool ok = tree.verify();
141 tree.getRoot() = Tree::Node::NullPtr;
177 template <
class Node>
178 void collect(
Node * p,
Node * parent, std::vector<std::pair<Node *, Node *>> &
out)
180 if (p == Node::NullPtr)
183 out.emplace_back(p, parent);
189 template <
class Tree>
198 std::vector<std::pair<Node *, Node *>>
nodes;
202 if constexpr (Seeded_Tree<Tree>)
203 tree.set_seed(20260710);
207 if (tree.
insert(pool.
make(10 * (17 * i % (num_keys + 1)))) ==
nullptr)
208 ADD_FAILURE() <<
"a new key was not inserted";
210 collect(tree.getRoot(),
static_cast<Node *
>(
nullptr), nodes);
217 template <
class Node>
218 class RedBlackNodes :
public ::testing::Test
224 using Red_Black_Node_Types = ::testing::Types<RbNode<int>,
RbNodeRk<int>>;
227 template <
class Node>
228 class AvlNodes :
public ::testing::Test
236 set_balance_factors(
root);
237 return counted(
root);
241 using Avl_Node_Types = ::testing::Types<AvlNode<int>,
AvlNodeRk<int>>;
244 template <
class Tree>
class AnyTreeVerify :
public ::testing::Test {};
245 template <
class Tree>
class RankedTreeVerify :
public ::testing::Test {};
246 template <
class Tree>
class RedBlackTreeVerify :
public ::testing::Test {};
247 template <
class Tree>
class AvlTreeVerify :
public ::testing::Test {};
248 template <
class Tree>
class TreapVerify :
public ::testing::Test {};
264 auto *
root = counted(t.black(8,
265 t.red(4, t.black(2, t.red(1)), t.black(6)),
266 t.red(12, t.black(10), t.black(14,
nullptr, t.red(15)))));
268 EXPECT_TRUE(is_red_black_tree_of(
root));
269 EXPECT_TRUE(has_equal_black_heights(
root));
270 EXPECT_TRUE(is_red_black_bst_of(
root));
275 using Node = TypeParam;
277 EXPECT_TRUE(is_red_black_tree_of(Node::NullPtr));
278 EXPECT_TRUE(is_red_black_bst_of(Node::NullPtr));
279 EXPECT_TRUE(is_red_black_tree_of(counted(this->t.black(1))));
280 EXPECT_TRUE(is_red_black_tree_of(counted(this->t.red(1))));
287 auto *
root = counted(t.red(8,
288 t.black(4, t.red(2), t.red(6)),
289 t.black(12,
nullptr, t.red(14))));
291 EXPECT_TRUE(is_red_black_tree_of(
root));
292 EXPECT_TRUE(is_red_black_bst_of(
root));
297TYPED_TEST(RedBlackNodes, RejectsARedNodeWithARedChildBelowTheRoot)
300 auto *
root = counted(t.black(8,
301 t.black(4, t.red(2, t.red(1)), t.red(6)),
302 t.black(12, t.red(10), t.red(14))));
304 ASSERT_TRUE(has_equal_black_heights(
root));
305 EXPECT_FALSE(is_red_black_tree_of(
root));
306 EXPECT_FALSE(is_red_black_bst_of(
root));
312 auto *
root = counted(t.black(8,
314 t.black(12,
nullptr, t.red(14,
nullptr, t.red(15)))));
316 EXPECT_FALSE(is_red_black_tree_of(
root));
321TYPED_TEST(RedBlackNodes, RejectsABlackNodeWithASingleBlackChild)
324 auto *
root = counted(t.black(8, t.black(4)));
326 EXPECT_FALSE(has_equal_black_heights(
root));
327 EXPECT_FALSE(is_red_black_tree_of(
root));
328 EXPECT_FALSE(is_red_black_bst_of(
root));
331TYPED_TEST(RedBlackNodes, RejectsASingleBlackChildDeepInTheTree)
334 auto *
root = counted(t.black(8,
335 t.black(4, t.red(2), t.red(6,
nullptr, t.black(7))),
338 EXPECT_FALSE(has_equal_black_heights(
root));
339 EXPECT_FALSE(is_red_black_tree_of(
root));
342TYPED_TEST(RedBlackNodes, RejectsSubtreesWithDifferentBlackHeights)
345 auto *
root = counted(t.black(8,
346 t.black(4, t.black(2), t.black(6)),
349 EXPECT_FALSE(has_equal_black_heights(
root));
350 EXPECT_FALSE(is_red_black_tree_of(
root));
353TYPED_TEST(RedBlackNodes, RejectsAColorThatIsNeitherRedNorBlack)
356 auto * odd = t.black(2);
357 auto *
root = counted(t.black(8, t.red(4, odd, t.black(6)), t.black(12)));
358 ASSERT_TRUE(is_red_black_tree_of(
root));
361 EXPECT_FALSE(is_red_black_tree_of(
root));
367 auto *
root = counted(t.black(8,
368 t.red(4, t.black(2), t.black(9)),
369 t.red(12, t.black(10), t.black(14))));
371 EXPECT_TRUE(is_red_black_tree_of(
root));
372 EXPECT_FALSE(is_red_black_bst_of(
root));
375TEST(RedBlackRankNodes, RejectsAWrongCounterBelowTheRoot)
377 Hand_Tree<RbNodeRk<int>> t;
378 auto * deep = t.black(2, t.red(1));
379 auto *
root = counted(t.black(8,
380 t.red(4, deep, t.black(6)),
381 t.red(12, t.black(10), t.black(14))));
389TEST(RedBlackTreesVerify, RejectTheHandMadeDefects)
391 Hand_Tree<RbNode<int>> t;
392 auto * red_red = t.black(8,
393 t.black(4, t.red(2, t.red(1)), t.red(6)),
394 t.black(12, t.red(10), t.red(14)));
395 auto * single_black_child = t.black(8, t.black(4));
396 auto * out_of_order = t.black(1, t.red(2), t.red(3));
397 auto * valid = t.black(2, t.red(1), t.red(3));
398 auto * red_root = t.red(2, t.black(1), t.black(3));
400 for (
auto *
root : {valid, red_root})
407 for (
auto *
root : {red_red, single_black_child, out_of_order})
415TEST(RedBlackRankTreesVerify, RejectTheHandMadeDefects)
417 Hand_Tree<RbNodeRk<int>> t;
418 auto * red_red = counted(t.black(8,
419 t.black(4, t.red(2, t.red(1)), t.red(6)),
420 t.black(12, t.red(10), t.red(14))));
421 auto * single_black_child = counted(t.black(8, t.black(4)));
422 auto * out_of_order = counted(t.black(1, t.red(2), t.red(3)));
423 auto * miscounted = counted(t.black(2, t.red(1), t.red(3)));
424 miscounted->getCount() = 4;
425 auto * valid = counted(t.black(2, t.red(1), t.red(3)));
426 auto * red_root = counted(t.red(2, t.black(1), t.black(3)));
428 for (
auto *
root : {valid, red_root})
435 for (
auto *
root : {red_red, single_black_child, out_of_order, miscounted})
443TEST(RedBlackTreesVerify, VerifyRedBlackLooksOnlyAtTheColors)
445 Hand_Tree<RbNode<int>> t;
446 auto * out_of_order = t.black(1, t.red(2), t.red(3));
447 auto * single_black_child = t.black(8, t.black(4));
453 EXPECT_FALSE(tree.
verify());
454 tree.
getRoot() = single_black_child;
463 EXPECT_FALSE(tree.
verify());
464 tree.
getRoot() = single_black_child;
478 auto *
root = this->finished(t.node(8,
479 t.node(4, t.node(2, t.node(1)), t.node(6)),
480 t.node(12,
nullptr, t.node(14))));
482 EXPECT_TRUE(is_avl_of(
root));
483 EXPECT_TRUE(is_avl_of(TypeParam::NullPtr));
484 EXPECT_TRUE(is_avl_of(this->finished(t.node(1))));
487TYPED_TEST(AvlNodes, RejectsAStoredFactorThatIsNotTheRealOneBelowTheRoot)
490 auto * deep = t.node(2, t.node(1));
491 auto *
root = this->finished(t.node(8,
492 t.node(4, deep, t.node(6)),
493 t.node(12,
nullptr, t.node(14))));
494 ASSERT_TRUE(is_avl_of(
root));
495 ASSERT_EQ(
DIFF(deep), -1);
497 for (
const int wrong : {-2, 0, 1, 2})
499 DIFF(deep) =
static_cast<signed char>(wrong);
500 EXPECT_FALSE(is_avl_of(
root)) <<
"factor " << wrong;
504 EXPECT_TRUE(is_avl_of(
root));
512 auto * leaning = t.node(12,
nullptr, t.node(14,
nullptr, t.node(15)));
513 auto *
root = this->finished(t.node(8,
514 t.node(4, t.node(2, t.node(1)), t.node(6)),
516 ASSERT_EQ(
DIFF(leaning), 2);
517 EXPECT_FALSE(is_avl_of(
root));
519 for (
const int claimed : {-1, 0, 1})
521 DIFF(leaning) =
static_cast<signed char>(claimed);
522 EXPECT_FALSE(is_avl_of(
root)) <<
"factor " << claimed;
526TEST(AvlRankNodes, RejectsAWrongCounterBelowTheRoot)
528 Hand_Tree<AvlNodeRk<int>> t;
529 auto * deep = t.node(2, t.node(1));
530 auto *
root = t.node(8, t.node(4, deep, t.node(6)), t.node(12,
nullptr, t.node(14)));
531 set_balance_factors(
root);
541TEST(AvlTreesVerify, RejectKeysOutOfOrder)
544 Hand_Tree<AvlNode<int>> t;
545 auto *
root = t.node(1, t.node(2), t.node(3));
548 EXPECT_TRUE(verified_by<
Avl_Tree<int>>(t.node(2, t.node(1), t.node(3))));
551 Hand_Tree<AvlNodeRk<int>> t;
552 auto *
root = counted(t.node(1, t.node(2), t.node(3)));
555 EXPECT_TRUE(verified_by<
Avl_Tree_Rk<int>>(counted(t.node(2, t.node(1), t.node(3)))));
563TEST(TreapNodes, IsTreapChecksTheHeapOrderAtEveryNode)
565 Hand_Tree<TreapNode<int>> t;
566 auto * deep = t.with_priority(30, 1);
567 auto *
root = t.with_priority(10, 8,
568 t.with_priority(20, 4, t.with_priority(25, 2, deep)),
569 t.with_priority(15, 12));
581TEST(TreapsVerify, RejectKeysOutOfOrder)
584 Hand_Tree<TreapNode<int>> t;
585 auto *
root = t.with_priority(1, 1, t.with_priority(2, 2), t.with_priority(3, 3));
588 EXPECT_TRUE(verified_by<
Treap<int>>(t.with_priority(1, 2, t.with_priority(2, 1),
589 t.with_priority(3, 3))));
592 Hand_Tree<Treap_Rk_Node<int>> t;
593 auto *
root = counted(t.with_priority(1, 1, t.with_priority(2, 2), t.with_priority(3, 3)));
596 EXPECT_TRUE(verified_by<
Treap_Rk<int>>(counted(t.with_priority(1, 2, t.with_priority(2, 1),
597 t.with_priority(3, 3)))));
601TEST(TreapsVerify, TreapRkRejectsAWrongCounter)
603 Hand_Tree<Treap_Rk_Node<int>> t;
604 auto * leaf = t.with_priority(3, 1);
605 auto *
root = counted(t.with_priority(1, 4, t.with_priority(2, 2, leaf), t.with_priority(5, 6)));
608 leaf->getCount() = 2;
612TEST(RankedNodes, CheckRankTreeChecksEveryCounter)
614 Hand_Tree<BinNodeXt<int>> t;
615 auto * deep = t.node(2, t.node(1));
616 auto *
root = t.node(8, t.node(4, deep, t.node(6)), t.node(12));
621 for (
const size_t wrong : {size_t(0), size_t(1), size_t(3)})
631TEST(RankedTreesVerify, RandTreeAndSplayTreeRkRejectKeysOutOfOrder)
634 Hand_Tree<Rand_Tree<int>::Node> t;
635 EXPECT_FALSE(verified_by<
Rand_Tree<int>>(counted(t.node(1, t.node(2), t.node(3)))));
636 EXPECT_TRUE(verified_by<
Rand_Tree<int>>(counted(t.node(2, t.node(1), t.node(3)))));
639 Hand_Tree<Splay_Tree_Rk<int>::Node> t;
640 EXPECT_FALSE(verified_by<
Splay_Tree_Rk<int>>(counted(t.node(1, t.node(2), t.node(3)))));
641 EXPECT_TRUE(verified_by<
Splay_Tree_Rk<int>>(counted(t.node(2, t.node(1), t.node(3)))));
647TEST(BstOrder, CheckBstComparesWithEveryAncestor)
649 Hand_Tree<BinNode<int>> t;
650 auto * stray = t.node(6);
651 auto *
root = t.node(8, t.node(4, t.node(2), stray), t.node(12));
660TEST(BstOrder, CheckBstFollowsTheComparator)
662 Hand_Tree<BinNode<int>> t;
663 auto * descending = t.node(8, t.node(12), t.node(4));
666 EXPECT_TRUE(
check_bst(descending, std::greater<int>()));
667 EXPECT_TRUE(
check_bst(t.node(5, t.node(5), t.node(5))));
674TYPED_TEST(AnyTreeVerify, AcceptsTheEmptyTreeAndWhatInsertBuilds)
676 EXPECT_TRUE(TypeParam().
verify());
678 Built_Tree<TypeParam> built;
679 ASSERT_EQ(built.nodes.size(),
size_t(built.num_keys));
680 EXPECT_TRUE(built.tree.verify());
683TYPED_TEST(AnyTreeVerify, RejectsTwoNeighborKeysSwappedAnywhere)
685 Built_Tree<TypeParam> built;
686 auto &
nodes = built.nodes;
687 ASSERT_TRUE(built.tree.verify());
689 for (
size_t i = 0; i + 1 <
nodes.size(); ++i)
691 auto * p =
nodes[i].first;
692 auto * q =
nodes[i + 1].first;
693 std::swap(
KEY(p),
KEY(q));
694 EXPECT_FALSE(built.tree.verify()) <<
"keys " <<
KEY(q) <<
" and " <<
KEY(p);
695 std::swap(
KEY(p),
KEY(q));
698 EXPECT_TRUE(built.tree.verify());
703 Built_Tree<TypeParam> built;
704 ASSERT_TRUE(built.tree.verify());
706 for (
auto & [p, parent] : built.nodes)
708 const size_t count = p->getCount();
710 p->getCount() =
count + 1;
711 EXPECT_FALSE(built.tree.verify()) <<
"key " <<
KEY(p) <<
", one more";
713 p->getCount() =
count - 1;
714 EXPECT_FALSE(built.tree.verify()) <<
"key " <<
KEY(p) <<
", one less";
716 p->getCount() =
count;
719 EXPECT_TRUE(built.tree.verify());
724 Built_Tree<TypeParam> built;
725 ASSERT_TRUE(built.tree.verify());
727 size_t reds = 0, blacks = 0;
728 for (
auto & [p, parent] : built.nodes)
734 EXPECT_FALSE(built.tree.verify()) <<
"key " <<
KEY(p) <<
", no color";
738 if (parent !=
nullptr)
741 EXPECT_FALSE(built.tree.verify()) <<
"key " <<
KEY(p) <<
", recolored";
748 EXPECT_GT(blacks, 1u);
749 EXPECT_TRUE(built.tree.verify());
754 Built_Tree<TypeParam> built;
755 ASSERT_TRUE(built.tree.verify());
757 for (
auto & [p, parent] : built.nodes)
759 const signed char factor =
DIFF(p);
761 for (
const int wrong : {-2, -1, 0, 1, 2})
764 DIFF(p) =
static_cast<signed char>(wrong);
765 EXPECT_FALSE(built.tree.verify()) <<
"key " <<
KEY(p) <<
", factor " << wrong;
771 EXPECT_TRUE(built.tree.verify());
774TYPED_TEST(TreapVerify, RejectsAPriorityBelowTheOneOfItsParentAnywhere)
776 Built_Tree<TypeParam> built;
777 ASSERT_TRUE(built.tree.verify());
780 for (
auto & [p, parent] : built.nodes)
782 if (parent ==
nullptr or
PRIO(parent) == 0)
785 const unsigned long priority =
PRIO(p);
787 EXPECT_FALSE(built.tree.verify()) <<
"key " <<
KEY(p);
792 EXPECT_GE(checked + 2, built.nodes.size());
793 EXPECT_TRUE(built.tree.verify());
803 template <
template <
typename,
class>
class Tree>
804 void check_set_in_descending_order()
807 for (
int i = 1; i <= 40; ++i)
810 EXPECT_TRUE(set.
verify());
811 EXPECT_EQ(set.
size(), 40u);
812 EXPECT_EQ(set.
min(), 40);
813 EXPECT_EQ(set.
max(), 1);
817# define CHECK_SET_IN_DESCENDING_ORDER(Tree) \
819 SCOPED_TRACE(#Tree); \
820 check_set_in_descending_order<Tree>(); \
823TEST(DynSetTreeVerify, ChecksTheOrderWithTheComparatorOfTheSet)
847 struct Comparator_Error {};
852 static inline bool fails =
false;
854 bool operator ()(
const int a,
const int b)
const
857 throw Comparator_Error();
863 struct Failing_Comparisons
865 Failing_Comparisons() noexcept { Fallible_Less::fails =
true; }
866 ~Failing_Comparisons() { Fallible_Less::fails =
false; }
869 using Trees_With_A_Fallible_Comparator = ::testing::Types<
879 struct Fallible_Tree_Names
881 template <
class Tree>
882 static std::string GetName(
const int i)
884 static constexpr const char * names[] = {
885 "BinTree",
"Avl_Tree",
"Avl_Tree_Rk",
"Rb_Tree",
"Rb_Tree_Rk",
886 "TdRbTree",
"TdRbTreeRk",
"HtdRbTree",
"HtdRbTreeRk",
"Treap",
887 "Treap_Rk",
"Rand_Tree",
"Splay_Tree",
"Splay_Tree_Rk"};
897 Fallible_Tree_Names);
903 using Tree = TypeParam;
904 static_assert(not
noexcept(std::declval<const Tree &>().verify()));
908 for (
const int key : {4, 2, 6, 1, 3, 5, 7})
909 ASSERT_NE(tree.
insert(pool.
make(key)),
nullptr);
910 ASSERT_TRUE(tree.verify());
913 const Failing_Comparisons failing;
914 EXPECT_THROW((
void) tree.verify(), Comparator_Error);
917 EXPECT_TRUE(tree.verify());
bool is_avl(Node *p)
Validate that a tree satisfies AVL properties.
#define DIFF(p)
Access the balance factor of node p.
WeightedDigraph::Node Node
size_t size_t int32_t * out
Extended AVL node with subtree counter.
Node for extended binary search tree.
Dynamic set backed by balanced binary search trees with automatic memory management.
const Key & min() const
Returns the smallest key contained in the set according to the criterion comparison given.
const size_t & size() const
Returns the cardinality of the set.
Key * insert(const Key &key)
Inserts a key into the dynamic set.
const Key & max() const
Returns the largest key contained in the set according to the criteria comparison given.
bool verify() const
Verify the red-black properties and the order of the keys.
bool verifyRedBlack() const noexcept
Verify that tree satisfies all red-black properties.
Node *& getRoot() noexcept
Get reference to root pointer.
Hybrid top-down/bottom-up red-black tree with rank support.
Hybrid top-down/bottom-up red-black tree.
Node *& getRoot() noexcept
Get reference to root pointer.
bool verifyRedBlack() const noexcept
Verify the red-black properties of every node.
bool verify() const
Verify tree is a valid red-black BST.
Extended Red-Black node with subtree counter.
Top-down red-black tree with rank (no virtual destructor).
Top-down red-black tree without virtual destructor.
Declare TreapNode type with 80-byte pool allocation.
Declare AvlNode type with 40-byte pool allocation.
Node for QuadTree spatial data structure.
QuadTree - Hierarchical spatial index for 2D points.
Point * insert(Node *&r, const Point &p)
Recursive insert helper.
Declare RbNode type with 128-byte pool allocation.
Owns the nodes of a tree, which does not free them.
Node * make(const int key)
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_max_function > > max(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
__gmp_expr< T, __gmp_binary_expr< __gmp_expr< T, U >, unsigned long int, __gmp_root_function > > root(const __gmp_expr< T, U > &expr, unsigned long int l)
int cmp(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
DynArray< Graph::Node * > nodes
bool check_rank_tree(Node *root) noexcept
Return true if root is a valid extended binary tree.
bool check_bst(Node *p, const Compare &cmp=Compare())
Return true if p is a binary search tree.
auto & COUNT(Node *p) noexcept
Return the number of nodes of the tree fron p is root.
unsigned long & PRIO(Node *p) noexcept
Access the priority of a treap node.
Main namespace for Aleph-w library functions.
bool is_treap(Node *root) noexcept
Validate that a tree satisfies treap (heap) property.
bool is_red_black_bst_rk(Node *node, Compare &cmp)
Verify that tree rooted at node is a valid red-black BST with counters.
bool is_red_black_tree_rk(Node *node)
Verify if tree is a valid red-black tree with correct counters.
bool is_avl_rk(Node *p)
Verify if tree rooted at p is a valid AVL tree with correct counters.
bool test_black_condition_rk(Node *p, int &max, int bh=0)
Test the black height condition for a red-black tree.
static long & color(typename GT::Node *p)
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
::testing::Types< Avl_Tree_Rk< int >, Rb_Tree_Rk< int >, TdRbTreeRk< int >, HtdRbTreeRk< int >, Treap_Rk< int >, Rand_Tree< int >, Splay_Tree_Rk< int > > Ranked_Trees
The trees whose nodes count the nodes of their subtree.
::testing::Types< BinTree< int >, Avl_Tree< int >, Avl_Tree_Rk< int >, Rb_Tree< int >, Rb_Tree_Rk< int >, TdRbTree< int >, TdRbTreeRk< int >, HtdRbTree< int >, HtdRbTreeRk< int >, Treap< int >, Treap_Rk< int >, Rand_Tree< int >, Splay_Tree< int >, Splay_Tree_Rk< int > > All_Trees
Every binary search tree of the library.
::testing::Types< Rb_Tree< int >, Rb_Tree_Rk< int >, TdRbTree< int >, TdRbTreeRk< int >, HtdRbTree< int >, HtdRbTreeRk< int > > Red_Black_Trees
The red-black trees.
::testing::Types< Treap< int >, Treap_Rk< int > > Treaps
The treaps.
::testing::Types< Avl_Tree< int >, Avl_Tree_Rk< int > > Avl_Trees
The AVL trees.
bool is_red_black_bst(Node *node, Compare &cmp)
Verify that tree is both a valid RB tree and valid BST.
bool test_black_condition(Node *p, int &max, int bh=0)
Test the black-height property of an RB tree.
#define BLACK
Black color constant.
#define RED
Red color constant (newly inserted nodes are red)
bool is_red_black_tree(Node *node)
Test RB properties for entire subtree.
What the tests of the binary search trees share: the list of tree types, what each node carries,...
Ranked AVL tree with nodes without a virtual destructor.
AVL binary search tree with nodes without a virtual destructor.
Binary search tree with nodes without virtual destructors,.
Randomized binary search tree.
Red-Black binary search tree with nodes without virtual destructor and with subtree counters for sele...
Red-black tree with nodes without virtual destructor.
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.
Names the instances of a typed test suite after their tree.
ValueArg< size_t > num_keys
Dynamic set implementations based on balanced binary search trees.
#define CHECK_SET_IN_DESCENDING_ORDER(Tree)
TYPED_TEST_SUITE(VerifyWithAFallibleComparator, Trees_With_A_Fallible_Comparator, Fallible_Tree_Names)
TYPED_TEST(RedBlackNodes, AcceptsAValidTree)