Dynamic prefix sum
问题 Is there any data structure which is able to return the prefix sum [1] of array, update an element, and insert/remove elements to the array, all in O(log n)? [1] "prefix sum" is the sum of all elements from the first one up to given index For example, given the array of non-negative integers 8 1 10 7 the prefix sum for first three elements is 19 ( 8 + 1 + 10 ). Updating the first element to 7 , inserting 3 as the second element and removing the third one gives 7 3 10 7 . Again, the prefix sum