Skip to content

Commit 7881a21

Browse files
authored
Merge pull request cp-algorithms#740 from ChangMarkusYu/ChangMarkusYu-segment_tree_typo
Fixed a small typo in segment_tree.md
2 parents 04a3392 + 6f9543e commit 7881a21

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/data_structures/segment_tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ The second query, that we are supposed to answer, asked simply for the value of
688688

689689
To make the addition query efficient, we store at each vertex in the Segment Tree how many we should add to all numbers in the corresponding segment.
690690
For example, if the query "add 3 to the whole array $a[0 \dots n-1]$" comes, then we place the number 3 in the root of the tree.
691-
In general we have to place this number multiple to multiple segments, which form a partition of the query segment.
691+
In general we have to place this number to multiple segments, which form a partition of the query segment.
692692
Thus we don't have to change all $O(n)$ values, but only $O(\log n)$ many.
693693

694694
If now there comes a query that asks the current value of a particular array entry, it is enough to go down the tree and add up all values found along the way.

0 commit comments

Comments
 (0)