Chairman of the tree line weights and summary

Chairman of the tree line weights and summary

Weight segment tree is the tree line right of each point, giving a definite meaning, the number of such number appears, the number of numerical prefix appears, and the interval with a sum maintain a range of information such as the number of times the number that appears first K and large (can not achieve large range of K), the K prefix and large.

Weight tree line advantages:

It can be relatively easy to achieve a balanced tree of a series of operations

A sequence, insert a number, delete a number, find the value of the number of ranking, query a small number of K, seeking smaller than the number of number, this number is greater than the demand number.

The above-described operations can be implemented segment tree right values. However, note that the range of the operand is too large, then the weight of the segment tree will open high, because the weight segment tree stored in a single point information nodes, i.e. the sequence of 1-N started, the need to All operations stored values, and discrete. Such weights tree line to some extent is the off-line algorithm.

 

Guess you like

Origin www.cnblogs.com/bluefly-hrbust/p/11354568.html