Skip to content

Commit 293858e

Browse files
wikkuadamant-pwn
authored andcommitted
Rename "implicit" to "dynamic" segment tree
1 parent 8c70471 commit 293858e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/data_structures/segment_tree.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,11 +1126,14 @@ It is easy to generate lookup tables (e.g. using $\text{map}$), that convert a v
11261126

11271127

11281128

1129-
### Implicit segment tree
1129+
### Dynamic segment tree
1130+
1131+
(Called so because its shape is dynamic and the nodes are usually dynamically allocated.
1132+
Also known as _implicit segment tree_ or _sparse segment tree_.)
11301133

11311134
Previously, we considered cases when we have the ability to build the original segment tree. But what to do if the original size is filled with some default element, but its size does not allow you to completely build up to it in advance?
1132-
1133-
We can solve this problem by not explicitly creating a segment tree. Initially, we will create only the root, and we will create the other vertexes only when we need them.
1135+
1136+
We can solve this problem by creating a segment tree lazily (incrementally). Initially, we will create only the root, and we will create the other vertexes only when we need them.
11341137
In this case, we will use the implementation on pointers(before going to the vertex children, check whether they are created, and if not, create them).
11351138
Each query has still only the complexity $O(\log n)$, which is small enough for most use-cases (e.g. $\log_2 10^9 \approx 30$).
11361139

src/sequences/longest_increasing_subsequence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ For instance we can use a [Segment tree](../data_structures/segment_tree.md) or
283283

284284
This method has obviously some **shortcomings**:
285285
in terms of length and complexity of the implementation this approach will be worse than the method using binary search.
286-
In addition if the input numbers $a[i]$ are especially large, then we would have to use some tricks, like compressing the numbers (i.e. renumber them from $0$ to $n-1$), or use an implicit Segment tree (only generate the branches of the tree that are important).
286+
In addition if the input numbers $a[i]$ are especially large, then we would have to use some tricks, like compressing the numbers (i.e. renumber them from $0$ to $n-1$), or use a dynamic segment tree (only generate the branches of the tree that are important).
287287
Otherwise the memory consumption will be too high.
288288

289289
On the other hand this method has also some **advantages**:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy