OSDN Git Service
(root)
/
oi-wiki
/
main.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04bf4de
)
Update segment.md
author
orzcyand1317
<36555123+orzcyand1317@users.noreply.github.com>
Sun, 3 Mar 2019 08:05:35 +0000
(16:05 +0800)
committer
GitHub
<noreply@github.com>
Sun, 3 Mar 2019 08:05:35 +0000
(16:05 +0800)
docs/ds/segment.md
patch
|
blob
|
history
diff --git
a/docs/ds/segment.md
b/docs/ds/segment.md
index
79372b1
..
a4e405b
100644
(file)
--- a/
docs/ds/segment.md
+++ b/
docs/ds/segment.md
@@
-59,8
+59,6
@@
void build(int s, int t, int p) {
关于线段树的空间,如果采用堆式存储(堆式储存可以理解为 $2\times p$ 是 p 的左儿子, $2 \times p+1$ 是 p 的右儿子),d 数组的大小应为 $2n$ (叶子节点共有 $n$ 个,非叶子结点的个数不会超过叶子结点数量),上界是 $2n-1$。如果采用动态开点,则需要多开两个数组来记录左儿子和右儿子的编号/地址。
-![](./images/segt5.png)
-
### 线段树的区间查询
区间查询,比如求区间 $[l,r]$ 的总和(即 $a[l]+a[l+1]+ \cdots +a[r]$ )、求区间最大值/最小值……还有很多很多……怎么做呢?