| 34 | } |
| 35 | |
| 36 | int main() |
| 37 | { |
| 38 | int freq[] = {2, 1, 1, 3, 2, 3, 4, 5, 6, 7, 8, 9}; |
| 39 | int n = sizeof(freq)/sizeof(freq[0]); |
| 40 | int *BITree = constructBITree(freq, n); |
| 41 | cout << "Sum of elements in arr[0..5] is " << getSum(BITree, 5); |
| 42 | |
| 43 | freq[3] += 6; |
| 44 | updateBIT(BITree, n, 3, 6); //Update BIT for above change in arr[] |
| 45 | |
| 46 | cout << "\nSum of elements in arr[0..5] after update is " << getSum(BITree, 5); |
| 47 | |
| 48 | return 0; |
| 49 | } |
nothing calls this directly
no test coverage detected