(self, parent_node: Node, child_index: int)
Take key from right brother of the child and transfer to the child
Take key from right brother of the child and transfer to the child
Take key from right brother of the child and transfer to the child
def _rotate_left(self, parent_node: Node, child_index: int):
        """
        Take key from right brother of the child and transfer to the child
        """
        new_child_key = parent_node.keys[child_index]
        new_parent_key = parent_node.children[child_index + 1].keys.pop(0)
        parent_node.children[child_index].keys.append(new_child_key)
        parent_node.keys[child_index] = new_parent_key

        if not parent_node.children[child_index + 1].is_leaf:
            ownerless_child = parent_node.children[child_index + 1].children.pop(0)
            # make ownerless_child as a new biggest child (with highest key) -> transfer from right subtree to left subtree
            parent_node.children[child_index].children.append(ownerless_child)
def _rotate_left ( self , parent_node : Node , child_index : int ) : new_child_key = parent_node . keys [ child_index ] new_parent_key = parent_node . children [ child_index + 1 ] . keys . pop ( 0 ) parent_node . children [ child_index ] . keys . append ( new_child_key ) parent_node . keys [ child_index ] = new_parent_key if not parent_node . children [ child_index + 1 ] . is_leaf : ownerless_child = parent_node . children [ child_index + 1 ] . children . pop ( 0 ) # make ownerless_child as a new biggest child (with highest key) -> transfer from right subtree to left subtree parent_node . children [ child_index ] . children . append ( ownerless_child )