You need strong understanding of recursion and binary trees. Segment trees support range queries (like sum, min, max over a range) and point updates, both in time. They're built by recursively dividing the array.
This is an advanced data structure. Complete easier tree problems first. Each node stores aggregate information for its segment. Queries combine information from non-overlapping segments that cover the query range.