public static boolean isBalanced(TreeNode root) {
    	if (null == root) {
    		return true;
    	}
    	if (isBalanced(root.left) && isBalanced(root.right)) {
    		int diff = getHeight(root.left) - getHeight(root.right);
    		if (diff < 2 && diff > -2) {
    			return true;
    		} else {
    			return false;
    		}
    	}
    	return false;
    }