Can I perform range updates in BIT with a condition. Lets say I have an array of negative and positive frequencies A[] = {1, -3, -4, 5, 9}. And I wanted to range update the values of the array with a condition : If the update value(x) is negative, update only negative elements and if the update value is positive, update only positive values in the range.
Example, in the above array, if the update query is 2 4 -2, (left right value), then update only 2nd(-3) and 3rd(-4) position. Leave 4th(5) position because its a positive integer.
Or should I use another data structure to accomplish this?
I used this to learn range updations.