Skip to content

Commit 7df7fcc

Browse files
Oleksandr Kulkovadamant-pwn
authored andcommitted
of using -> by using
1 parent ee256b1 commit 7df7fcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/data_structures/segment_tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ The green vertices are the vertices that we visit and update.
159159
The main consideration is how to store the Segment Tree.
160160
Of course we can define a $\text{Vertex}$ struct and create objects, that store the boundaries of the segment, its sum and additionally also pointers to its child vertices.
161161
However, this requires storing a lot of redundant information in the form of pointers.
162-
We will use a simple trick to make this a lot more efficient of using an _implicit data structure_: Only storing the sums in an array.
162+
We will use a simple trick to make this a lot more efficient by using an _implicit data structure_: Only storing the sums in an array.
163163
(A similar method is used for binary heaps).
164164
The sum of the root vertex at index 1, the sums of its two child vertices at indices 2 and 3, the sums of the children of those two vertices at indices 4 to 7, and so on.
165165
With 1-indexing, conveniently the left child of a vertex at index $i$ is stored at index $2i$, and the right one at index $2i + 1$.

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