Returns sum of arr [ 0. . index ] . This function assumes that the array is preprocessed and partial sums of array elements are stored in BITree [ ] .
static int getSum ( int [ ] BITree , int index ) {