operator []= method

void operator []=(
  1. int index,
  2. int value
)

Updates the n-th element of this tree in O(log n).

Implementation

void operator []=(int index, int value) => update(index, value - this[index]);