changing all the occurances of x by y in an array

I Have an array.there is a operation and that is changing all the occurances of x by y.
how this can be done by BINARY INDEXED TREE?