A data structure for computing running totals in arbitrary dimensions in O(ln(n))