findSuccessor(node) {
        // let node = this.find(data);

        // if (!node) {
        //     throw new Error(`node with data(${data}) is not in the tree`);
        // }

        if (!node.rchild) {
            return null;
        }

        let suc = node.rchild;
        let tmp;
        while (!this._isNilNode(tmp = suc.lchild)) {
            suc = tmp;
        }

        return suc;
    }
/**
     * find successor node of this node
     *  if this node doesn't have the right subtree, return null
     *
     * @param {BinaryTreeNode} current node
     * @return {BinaryTreeNode|Null}
     */
find successor node of this node
if this node doesn't have the right subtree, return null


find successor node of this node if this node doesn ' t have the right subtree return null
findSuccessor(node) {
        if (!node.rchild) {
            return null;
        }
        let suc = node.rchild;
        let tmp;
        while (!this._isNilNode(tmp = suc.lchild)) {
            suc = tmp;
        }
        return suc;
    }
findSuccessor ( node ) { if ( ! node . rchild ) { return null ; } let suc = node . rchild ; let tmp ; while ( ! this . _isNilNode ( tmp = suc . lchild ) ) { suc = tmp ; } return suc ; }
find successor node of this node
  if this node doesn't have the right subtree, return null
find successor node of this node if this node doesn ' t have the right subtree return null
// let node = this.find(data);
 // if (!node) {
 //     throw new Error(`node with data(${data}) is not in the tree`);
 // }
