code: func (t *Mutable) relinkGrandparent(node, parent, grandparent *treapNode) {
  	// The node is now the root of the tree when there is no grandparent.
  	if grandparent == nil {
  		t.root = node
  		return
  	}
  
  	// Relink the grandparent's left or right pointer based on which side
  	// the old parent was.
  	if grandparent.left == parent {
  		grandparent.left = node
  	} else {
  		grandparent.right = node
  	}
  }
docs: // relinkGrandparent relinks the node into the treap after it has been rotated
  // by changing the passed grandparent's left or right pointer, depending on
  // where the old parent was, to point at the passed node.  Otherwise, when there
  // is no grandparent, it means the node is now the root of the tree, so update
  // it accordingly.