Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Fenwick Tree (Binary Indexed Tree)
Bookmark
Input
Standard
Small
Larger
Multiples of 10
Custom
arr
=
[1, 3, 5, 7, 9, 2]
,
updateIndex
=
2
,
updateValue
=
10
,
queryIndex
=
4
Phase: Build
Original Array (0-indexed)
1
0
3
1
5
2
7
3
9
4
2
5
BIT Array (1-indexed)
0
1
0
2
0
3
0
4
0
5
0
6
[1]
[1..2]
[3]
[1..4]
[5]
[5..6]
algo
master
.
io
Step:
Start: Demonstrate Fenwick Tree (Binary Indexed Tree) operations — build, point update, and prefix sum query.
0 / 27
Input
Standard
Small
Larger
Multiples of 10
Custom
arr
=
[1, 3, 5, 7, 9, 2]
,
updateIndex
=
2
,
updateValue
=
10
,
queryIndex
=
4
0 / 27
Phase: Build
Original Array (0-indexed)
1
0
3
1
5
2
7
3
9
4
2
5
BIT Array (1-indexed)
0
1
0
2
0
3
0
4
0
5
0
6
[1]
[1..2]
[3]
[1..4]
[5]
[5..6]
algo
master
.
io
Step:
Start: Demonstrate Fenwick Tree (Binary Indexed Tree) operations — build, point update, and prefix sum query.