'Link two nodes, making the one with the smaller value the parent of
the other.'

def _link(self, root, other):

    if (other.value < root.value):
        (root, other) = (other, root)
    next = root.left
    other.next = next
    if (next is not None):
        next.prev = other
    other.prev = None
    root.left = other
    other.parent = root
    return root
