Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
Loading...
Searching...
No Matches
binary_search_tree< T >::bst_node Struct Reference

A struct to represent a node in the Binary Search Tree. More...

Collaboration diagram for binary_search_tree< T >::bst_node:
[legend]

Public Member Functions

 bst_node (T _value)
 

Public Attributes

value
 
std::unique_ptr< bst_nodeleft
 
std::unique_ptr< bst_noderight
 

Detailed Description

template<class T>
struct binary_search_tree< T >::bst_node

A struct to represent a node in the Binary Search Tree.

Constructor & Destructor Documentation

◆ bst_node()

template<class T >
binary_search_tree< T >::bst_node::bst_node ( T _value)
inlineexplicit

Constructor for bst_node, used to simplify node construction and smart pointer construction.

Parameters
_valueThe value of the constructed node.
35 {
36 value = _value;
37 left = nullptr;
38 right = nullptr;
39 }
std::unique_ptr< bst_node > right
Definition binary_search_tree2.cpp:28
T value
Definition binary_search_tree2.cpp:26

Member Data Documentation

◆ left

template<class T >
std::unique_ptr<bst_node> binary_search_tree< T >::bst_node::left

Pointer to left subtree.

◆ right

template<class T >
std::unique_ptr<bst_node> binary_search_tree< T >::bst_node::right

Pointer to right subtree.

◆ value

template<class T >
T binary_search_tree< T >::bst_node::value

The value/key of the node.


The documentation for this struct was generated from the following file: