Skip to content

Commit 7322320

Browse files
authored
Update segment_tree.md
1 parent 0dfcbac commit 7322320

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/data_structures/segment_tree.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ There are three possible cases:
9191

9292
So, processing a sum query is a function that recursively calls itself with left and right children until it finds a complete or no overlap between ranges.
9393

94-
So processing a sum query is a function that recursively calls itself once with either the left or the right child (without changing the query boundaries), or twice, once for the left and once for the right child (by splitting the query into two subqueries). And the recursion ends, whenever the boundaries of the current query segment coincides with the boundaries of the segment of the current vertex. In that case the answer will be the precomputed value of the sum of this segment, which is stored in the tree.
95-
9694
In other words, the calculation of the query is a traversal of the tree, which spreads through all necessary branches of the tree, and uses the precomputed sum values of the segments in the tree.
9795

9896
Obviously we will start the traversal from the root vertex of the Segment Tree.

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