code: function add(tree, key, value) {
    if (!tree) {
      return create(key, value)
    }
  
    switch (compare(tree.key, key)) {
      case -1:
        tree.left = add(tree.left, key, value)
        return balance(tree) == -2 ? add_left(tree, key) : patch(tree)
      case 1:
        tree.right = add(tree.right, key, value)
        return balance(tree) == 2 ? add_right(tree, key) : patch(tree)
      case 0:
        tree.value = value
        break
      default:
        break
    }
  
    return tree
  }
docs: insert new key / value into AVL tree
  @param tree
  @param key
  @param value
  @returns {*}