anwering queries on anarray using binary indexed tree