src/avl-tree.js
function maxValueNode(root) {
  var current = root;
  while (current.right) {
    current = current.right;
  }
  return current;
}
function maxValueNode(root) {
  var current = root;
  while (current.right) {
    current = current.right;
  }
  return current;
}
function maxValueNode ( root ) { var current = root ; while ( current . right ) { current = current . right ; } return current ; }
Gets the maximum value node, rooted in a particular node.

@private
@param {Node} root The node to search.
@return {Node} The node with the maximum key in the tree.
Gets the maximum value node rooted in a particular node .