Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tree_path_capacity_test.cc File Reference

The search path of a balanced tree holds the head node and then up to Node::MaxHeight nodes, so a tree as tall as MaxHeight can be updated at its deepest level. More...

#include <gtest/gtest.h>
#include <memory>
#include <vector>
#include <tpl_avl.H>
#include <tpl_binNodeUtils.H>
#include <tpl_rb_tree.H>
Include dependency graph for tree_path_capacity_test.cc:

Go to the source code of this file.

Classes

class  Short_AvlNode< Key >
 
class  Short_AvlNodeVtl< Key >
 
class  Short_RbNode< Key >
 
class  Short_RbNodeVtl< Key >
 

Functions

 TEST (TreePathCapacity, AvlTreeAsTallAsMaxHeight)
 
 TEST (TreePathCapacity, RbTreeAsTallAsMaxHeight)
 

Detailed Description

The search path of a balanced tree holds the head node and then up to Node::MaxHeight nodes, so a tree as tall as MaxHeight can be updated at its deepest level.

The trees are built on nodes with a MaxHeight of 4, which 15 keys fill. Removing a leaf at depth 3 builds a path of 5 entries: before the path reserved a slot for the head node, the last push overflowed it (a Debug assertion, a write past the inline storage otherwise).

Definition in file tree_path_capacity_test.cc.

Function Documentation

◆ TEST() [1/2]

TEST ( TreePathCapacity  ,
AvlTreeAsTallAsMaxHeight   
)

◆ TEST() [2/2]

TEST ( TreePathCapacity  ,
RbTreeAsTallAsMaxHeight   
)