src/data/Tree.js
function (depth) {
        var height = 0;
        this.depth = depth;
        for (var i = 0; i < this.children.length; i++) {
            var child = this.children[i];
            child.updateDepthAndHeight(depth + 1);
            if (child.height > height) {
                height = child.height;
            }
        }
        this.height = height + 1;
    }
function (depth) {
        var height = 0;
        this.depth = depth;
        for (var i = 0; i < this.children.length; i++) {
            var child = this.children[i];
            child.updateDepthAndHeight(depth + 1);
            if (child.height > height) {
                height = child.height;
            }
        }
        this.height = height + 1;
    }
function ( depth ) { var height = 0 ; this . depth = depth ; for ( var i = 0 ; i < this . children . length ; i ++ ) { var child = this . children [ i ] ; child . updateDepthAndHeight ( depth + 1 ) ; if ( child . height > height ) { height = child . height ; } } this . height = height + 1 ; }
Update depth and height of this subtree.

@param  {number} depth
Update depth and height of this subtree .