lib/Oimo.js
function(leaf){
        if(leaf==this.root){
            this.root=null;
            return;
        }
        var parent=leaf.parent;
        var sibling;
        if(parent.child1==leaf){
            sibling=parent.child2;
        }else{
            sibling=parent.child1;
        }
        if(parent==this.root){
            this.root=sibling;
            sibling.parent=null;
            return;
        }
        var grandParent=parent.parent;
        sibling.parent=grandParent;
        if(grandParent.child1==parent){
            grandParent.child1=sibling;
        }else{
            grandParent.child2=sibling;
        }
        if(this.numFreeNodes<16384){
            this.freeNodes[this.numFreeNodes++]=parent;
        }
        do{
            grandParent=this.balance(grandParent);
            this.fix(grandParent);
            grandParent=grandParent.parent;
        }while(grandParent!=null);
    }
function(leaf){
        if(leaf==this.root){
            this.root=null;
            return;
        }
        var parent=leaf.parent;
        var sibling;
        if(parent.child1==leaf){
            sibling=parent.child2;
        }else{
            sibling=parent.child1;
        }
        if(parent==this.root){
            this.root=sibling;
            sibling.parent=null;
            return;
        }
        var grandParent=parent.parent;
        sibling.parent=grandParent;
        if(grandParent.child1==parent){
            grandParent.child1=sibling;
        }else{
            grandParent.child2=sibling;
        }
        if(this.numFreeNodes<16384){
            this.freeNodes[this.numFreeNodes++]=parent;
        }
        do{
            grandParent=this.balance(grandParent);
            this.fix(grandParent);
            grandParent=grandParent.parent;
        }while(grandParent!=null);
    }
function ( leaf ) { if ( leaf == this . root ) { this . root = null ; return ; } var parent = leaf . parent ; var sibling ; if ( parent . child1 == leaf ) { sibling = parent . child2 ; } else { sibling = parent . child1 ; } if ( parent == this . root ) { this . root = sibling ; sibling . parent = null ; return ; } var grandParent = parent . parent ; sibling . parent = grandParent ; if ( grandParent . child1 == parent ) { grandParent . child1 = sibling ; } else { grandParent . child2 = sibling ; } if ( this . numFreeNodes < 16384 ) { this . freeNodes [ this . numFreeNodes ++ ] = parent ; } do { grandParent = this . balance ( grandParent ) ; this . fix ( grandParent ) ; grandParent = grandParent . parent ; } while ( grandParent != null ) ; }
Delete a leaf from the tree.
@param   node
Delete a leaf from the tree .