TheAlgorithms/C++ 1.0.0
All the 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.

Definition at line 25 of file binary_search_tree2.cpp.

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.

Definition at line 35 of file binary_search_tree2.cpp.

35 {
36 value = _value;
37 left = nullptr;
38 right = nullptr;
39 }
std::unique_ptr< bst_node > right

Member Data Documentation

◆ left

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

Pointer to left subtree.

Definition at line 27 of file binary_search_tree2.cpp.

◆ right

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

Pointer to right subtree.

Definition at line 28 of file binary_search_tree2.cpp.

◆ value

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

The value/key of the node.

Definition at line 26 of file binary_search_tree2.cpp.


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