Segment Tree and Binary Index Tree
http://pages.cs.wisc.edu/~dieter/ICPC/18-19/advanced-topics/seg-tree-bin-indexed-tree.html
these two data structures are used in LC307/308 which is range sum query 1D and 2D problem. segment tree can be used in 1D as a improved method to solve this kind of problem, and BIT can be used to solve 2D.
the difference between those two data structures:
https://www.quora.com/What-is-the-difference-between-a-segment-tree-and-a-Fenwick-tree-binary-index-tree
for more detailed explaination, please refer to CSpiration

浙公网安备 33010602011771号