4 ms·
The one that works for sum works for all associative functions. One can do a bit better using the same amount of space, but with query time O(α(n)), where α is
by chaoxu 7y ago
The one that works for sum works for all associative functions. One can do a bit better using the same amount of space, but with query time O(α(n)), where α is the inverse Ackermann function. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.79.1554 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.79.1...