Segment Tree

Range queries & updates in O(log n).