Tacca's xianduanshu study notes (yes I just do not want to let everyone see hh)

Well, starting today, finishing two points knowledge of it every day.

 

The first is today's hero - segment tree! Before learning segment tree, I have learned a priority queue and learned to use an array to simulate heap for a binary tree has also been some understanding of what happens today to reach tree line.

 

Followed by Amway:

(HH learning segment tree mentality of) novice, then take a look at the Valley of Los template title QAQ

 

(Due to the template of what have been promising, then HH here to talk about their own understanding of it)

Tree line, in my opinion, is the tool of a contiguous range of operation. The basic operations are:

1. achievements: in fact a backtracking process is to start down the first node to establish a good, but not the assignment, then the assignment in a recursive come back. (Because the tree line store itself is a period interval and)

2. Query: query here is a binary search, pay attention here with just the turn when the assignment is from looking down (just thinking like this

3. Add the same time: the adder may be used herein lazytag, is a value record to be changed on the root node, and then transmitted from the top down, the real time is necessary to add the interval length count;

4. Multiplication: an adder and the like, Note that the first multiply-add (according to the law of four operations), while the amount of calculations step also.

 

Well, in short, learned to segment tree, feel the addition of a powerful weapon, strange confidence increased? (Fog)

Guess you like

Origin www.cnblogs.com/hhlys/p/12597165.html