Hello , i want to know how to do a binary search for something ( like lowerbound for a value ) on a binary indexeded tree in (log ( n ) ) . On a segment tree it can be done in Log ( N ) but on binary indexed tree the naive binary search is LOG^2 ( n ) . So does anyone know how to make it in Log(n) ? thanks in advance .
Well, if you implement both log(n) with ST and log2(n) with BIT you will be quite surprised seeing which one is faster.
I do know :)
Here is my old article on this topic link