fn double_left_rotate(
        &mut self,
        current_root: &NodeId,
        left_child: &NodeId,
        right_child: &NodeId,
    ) -> NodeId {
        let this = self.state();
        let new_root = this.tree.left(right_child);
        let (new_left_balance, new_right_balance) = match this.tree.balance(&new_root) {
            a if a == 0 => (0i8, 0i8),
            a if a == -1 => (0i8, 1i8),
            a if a == 1 => (-1i8, 0i8),
            a => panic!("Invalid balance {}", a),
        };
        let new_left_child = InternalNode::update(
            current_root,
            left_child,
            &this.tree.left(&new_root),
            new_left_balance,
        );
        let new_right_child = InternalNode::update(
            right_child,
            &this.tree.right(&new_root),
            &this.tree.right(right_child),
            new_right_balance,
        );
        let root = InternalNode::update(&new_root, &new_left_child, &new_right_child, 0i8);
        this.tree.root = Some(root.clone());
        root
    }
///
/// Assumes the conditions for the double left rotation have already been established
/// and rightChild.left.visited = true
/// neither child needs to be attached to currentRoot
///
Assumes the conditions for the double left rotation have already been established
and rightChild.left.visited = true
neither child needs to be attached to currentRoot
Assumes the conditions for the double left rotation have already been established and rightChild . left . visited = true neither child needs to be attached to currentRoot
fn double_left_rotate(
        &mut self,
        current_root: &NodeId,
        left_child: &NodeId,
        right_child: &NodeId,
    ) -> NodeId {
        let this = self.state();
        let new_root = this.tree.left(right_child);
        let (new_left_balance, new_right_balance) = match this.tree.balance(&new_root) {
            a if a == 0 => (0i8, 0i8),
            a if a == -1 => (0i8, 1i8),
            a if a == 1 => (-1i8, 0i8),
            a => panic!("Invalid balance {}", a),
        };
        let new_left_child = InternalNode::update(
            current_root,
            left_child,
            &this.tree.left(&new_root),
            new_left_balance,
        );
        let new_right_child = InternalNode::update(
            right_child,
            &this.tree.right(&new_root),
            &this.tree.right(right_child),
            new_right_balance,
        );
        let root = InternalNode::update(&new_root, &new_left_child, &new_right_child, 0i8);
        this.tree.root = Some(root.clone());
        root
    }
fn double_left_rotate ( & mut self , current_root : & NodeId , left_child : & NodeId , right_child : & NodeId , ) -> NodeId { let this = self . state ( ) ; let new_root = this . tree . left ( right_child ) ; let ( new_left_balance , new_right_balance ) = match this . tree . balance ( & new_root ) { a if a == 0 => ( 0i8 , 0i8 ) , a if a == - 1 => ( 0i8 , 1i8 ) , a if a == 1 => ( - 1i8 , 0i8 ) , a => panic ! ( " " a ) , } ; let new_left_child = InternalNode :: update ( current_root , left_child , & this . tree . left ( & new_root ) , new_left_balance , ) ; let new_right_child = InternalNode :: update ( right_child , & this . tree . right ( & new_root ) , & this . tree . right ( right_child ) , new_right_balance , ) ; let root = InternalNode :: update ( & new_root , & new_left_child , & new_right_child , 0i8 ) ; this . tree . root = Some ( root . clone ( ) ) ; root }
Assumes the conditions for the double left rotation have already been established
and rightChild.left.visited = true
neither child needs to be attached to currentRoot
Assumes the conditions for the double left rotation have already been established and rightChild . left . visited = true neither child needs to be attached to currentRoot
&mut self
current_root
&NodeId
left_child
&NodeId
right_child
&NodeId
&mut self
current_root
&NodeId
left_child
&NodeId
right_child
&NodeId