title: Fenwick tree vs Segment tree
body: <p>I needed to compute sums within a range on an array, so I came across Segment Tree and Fenwick Tree and I noticed that both of these trees query and update with the same asymptotic running time. I did a bit more research, and these 2 data structures seem to do everything at the same speed. Both have linear memory usage (Segment Tree uses twice as much).</p>
  <p>Aside from constant factors in running-time/memory and implementations, is there any reason why I would choose one over the other?</p>
  <p>I am looking for an objective answer, like some operation that is faster with one than the other, or maybe some restriction one has that the other does not.</p>
  <p>I saw 2 other StackOverflow questions about this, but the answers just described both data structures rather than explaining when one might be better than the other.</p>