function leftRotation(node) {
  const newParent = node.right; // E.g., node 16
  const grandparent = node.parent; // E.g., node 1
  const previousLeft = newParent.left; // E.g., node 8

  // swap parent of node 4 from node 1 to node 16
  swapParentChild(node, newParent, grandparent);

  // Update node 16 left child to be 4, and
  // updates node 4 parent to be node 16 (instead of 1).
  newParent.setLeftAndUpdateParent(node);
  // set node4 right child to be previousLeft (node 8)
  node.setRightAndUpdateParent(previousLeft);

  return newParent;
}
Single Left Rotation (LL Rotation)

@example: #1 tree with values 1-2-3-4

1                                 1
 \                                 \
  2*                                3
   \    --left-rotation(2)->      /  \
    3                           2*    4
     \
      4

@example: #2 left rotation

    1                                          1
     \                                          \
      4*                                         16
     / \                                        / \
   2    16    -- left-rotation(4) ->          4   32
      /  \                                   / \    \
     8   32                                2   8    64
           \
           64
@param {TreeNode} node current node to rotate (e.g. 4)
@returns {TreeNode} new parent after the rotation (e.g. 16)