Builds a tree-based data structure for range queries (sum, min, max) in O(n) time and space.
Explain code with DocComment! Try out your own code!