Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::tree_node_detail Namespace Reference

Classes

struct  Bin_Pair
 A node of a forest and its node in the binary tree. More...
 
struct  Position
 A node of a path that a traversal follows, and its position among its siblings. More...
 

Functions

template<class Node >
void free_detached_tree (Node *root) noexcept
 Frees a tree that has no parent nor siblings, without recursion; it finds the nodes by their sibling links (see destroy_tree()).
 
template<class Node >
void detach_tree (Node *root) noexcept
 
template<class BNode >
void free_bin_tree (BNode *root) noexcept
 Frees the binary tree root without recursion nor memory: a node with a left child turns into the right child of that child first.
 

Function Documentation

◆ detach_tree()

template<class Node >
void Aleph::tree_node_detail::detach_tree ( Node *  root)
noexcept

◆ free_bin_tree()

template<class BNode >
void Aleph::tree_node_detail::free_bin_tree ( BNode *  root)
noexcept

Frees the binary tree root without recursion nor memory: a node with a left child turns into the right child of that child first.

Definition at line 1697 of file tpl_tree_node.H.

References LLINK, RLINK, and root().

Referenced by Aleph::forest_to_bin().

◆ free_detached_tree()

template<class Node >
void Aleph::tree_node_detail::free_detached_tree ( Node *  root)
noexcept

Frees a tree that has no parent nor siblings, without recursion; it finds the nodes by their sibling links (see destroy_tree()).

Definition at line 1385 of file tpl_tree_node.H.

References Aleph::Dlink::append(), Aleph::Dlink::concat_list(), Aleph::Dlink::is_empty(), Aleph::Dlink::remove_next(), root(), SIBLING_LIST, and Aleph::Dlink::wrap_header().

Referenced by Aleph::destroy_tree().