Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Segment Tree
Bookmark
Input
Standard
Small
Large
Tens
Custom
arr
=
[1, 3, 5, 7, 9, 11]
,
queryL
=
1
,
queryR
=
4
,
updateIdx
=
2
,
updateVal
=
10
arr
1
0
3
1
5
2
7
3
9
4
11
5
algo
master
.
io
Step:
Start: Build a Segment Tree from array [1, 3, 5, 7, 9, 11], then query sum of range [1, 4] and update index 2 to 10.
0 / 52
Input
Standard
Small
Large
Tens
Custom
arr
=
[1, 3, 5, 7, 9, 11]
,
queryL
=
1
,
queryR
=
4
,
updateIdx
=
2
,
updateVal
=
10
0 / 52
arr
1
0
3
1
5
2
7
3
9
4
11
5
algo
master
.
io
Step:
Start: Build a Segment Tree from array [1, 3, 5, 7, 9, 11], then query sum of range [1, 4] and update index 2 to 10.