Binary Indexed tree

Not oble to understand this MCQ.

Hey @Sfo_2302
Please share the screenshot of the question

For range sum queries, we would like to build the BIT in O(N) time complexity for a given array A[1], A[2], … , A[N]. Let us say we build the prefix array P[1], P[2], …, P[N] where P[i] = A[1] + A[2] + … + A[i]. Choose the correct option : 1) BIT[x] = P[x] - P[ x + LSOne(x) ] 2)BIT[x] = P[x] - P[ x - LSOne(x) ] 3)BIT[x] = P[N] - P[x ^ LSOne(x) ] 4)It is not possible to build the BIT in O(N) time.

how can i send SS of this question here?

Here refer to this : Fenwick Tree Quiz :slight_smile: