Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8bb7c9

Browse files
Naman-Bhallajakobkogler
authored andcommitted
Fix typo (note -> node) (#415)
1 parent 60856da commit d8bb7c9

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
@@ -43,7 +43,7 @@ Here is a visual representation of such a Segment Tree over the array $a = [1, 3
4343
!["Sum Segment Tree"](&imgroot&/sum-segment-tree.png)
4444

4545
From this short description of the data structure, we can already conclude that a Segment Tree only requires a linear number of vertices.
46-
The first level of the tree contains a single note (the root), the second level will contain two vertices, in the third it will contain four vertices, until the number of vertices reaches $n$.
46+
The first level of the tree contains a single node (the root), the second level will contain two vertices, in the third it will contain four vertices, until the number of vertices reaches $n$.
4747
Thus the number of vertices in the worst case can be estimated by the sum $1 + 2 + 4 + \dots + 2^{\lceil\log_2 n\rceil} = 2^{\lceil\log_2 n\rceil + 1} \lt 4n$.
4848

4949
It is worth noting that whenever $n$ is not a power of two, not all levels of the Segment Tree will be completely filled.

0 commit comments

Comments
 (0)