Segment tree

For interval sum, you can use segment tree.

https://www.cnblogs.com/jason2003/p/9676729.html
This one restores the segment tree as linked lists.

https://www.geeksforgeeks.org/segment-tree-set-1-sum-of-given-range/
This one restores the segment tree as array.

The construction of segment tree from the array is recursion.

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页