Fenwick tree vs Segment tree
I read this on Quora. Hope you find it useful. There are things that a segment tree can do but a BIT cannot : A BIT essentially works with cumulative quantities. When the cumulative quantity for interval [i..j] is required, it is found as the difference between cumulative quantities for [1…j] and [1…i-1]. This works … Read more