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