You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
625 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 线段数
>- 区间数的操作,增加更新查询
>- 用树表示累加和,将数组拆分为二叉树,利用数组实现二叉树
>- ![img.png](img.png)
>- ![img_1.png](img_1.png)
>- 准备4倍N的临时数组因为最后一层为2N个数前面也为2N个数
### 懒更新
>- ![img_2.png](img_2.png)
>- 在树结构中,把规定下标的数增加
>- 找到包含所有片段的树节点
>- 创建懒更新信息数组,在需要增加的数组上填充数字
>- ![img_3.png](img_3.png)
>- 当新任务来的时候,把懒信息向下层发送,然后清空
>- 执行新任务
>- ![img_4.png](img_4.png)