LeetCode Segment Tree and BIT Related Problems

As we know, the segement tree and BIT are essentiallt the same, they are both used to get the sum range of a dynamic list in a relatively short time.
but, beside the classic usuage of segment tree and BIT in sum range query, we also can apply them in the following problems:
LC218 The SkyLine problem. this problem seems have no connection to segment tree.
LC327 Count of Range Sum: Classic Range sum problem. we can use divide and conquer or segment tree to do that.
LC493 Reverse Pairs: very easy yo understand the problem: Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important reverse pairs in the given array.
LC699 failing squares: the meaning of this problem is hard to understand first, check my other article to get more details.

posted @ 2020-12-22 01:39  EvanMeetTheWorld  阅读(24)  评论(0)    收藏  举报