
#ifndef BST_NODE_HPP
# define BST_NODE_HPP

# include <cstddef> // NULL

namespace ft {

template < typename ValueType >
struct node
{
	ValueType	value;
	node		*up;
	node		*left;
	node		*right;
	short		height;

	node(const ValueType& val) : value(val), up(NULL), left(NULL), right(NULL), height(1) {}

	node*	min()
	{ 
		node*	n = this;

		while (n->left)
			n = n->left;
		return n;
	}

	node*	max()
	{ 
		node*	n = this;

		while (n->right)
			n = n->right;
		return n;
	}
};

template < typename ValueType >
struct node_sentinel
{
	node<ValueType>	*child;

	node_sentinel() : child(NULL) {}
};

} // namespace ft

#endif

