namespace DataStructures.BinarySearchTree;
///
/// Generic node class for BinarySearchTree.
/// Keys for each node are immutable.
///
/// Type of key for the node. Keys must implement IComparable.
public class BinarySearchTreeNode
{
///
/// Initializes a new instance of the class.
///
/// The key of this node.
public BinarySearchTreeNode(TKey key) => Key = key;
///
/// Gets the key for this node.
///
public TKey Key { get; }
///
/// Gets or sets the reference to a child node that precedes/comes before this node.
///
public BinarySearchTreeNode? Left { get; set; }
///
/// Gets or sets the reference to a child node that follows/comes after this node.
///
public BinarySearchTreeNode? Right { get; set; }
}