A Binary Search Tree is a structure in the form of a binary tree, satisfying that for every node, the values of all the nodes in its left subtree are smaller than its value, and the values of all the nodes in its right subtree are greater (we are assuming the tree has no repeated nodes).
Consider the following implementation of a node of a BST:
Implement the function
that returns the node with the smallest value that is greater than the value of the current node, or nullptr if the current node has the greatest value.
Observation You only need to submit the required classes; your main program will be ignored. Strictly obey the type definitions of the statement.