Open
Description
Sometimes the method won't return the correct value.
How to reproduce:
FenwickTree ft(10);
for (int i = 1; i <= 10; i++){
ft.update(i,1);
}
for (int i = 1; i <= 10; i++){
cout << ft.select(i) << "\n";
}
Expected output:
1
2
3
4
5
6
7
8
9
10
Obtained result:
1
2
3
4
5
6
7
8
16
16
Code execution: https://ideone.com/k5IMXN
Metadata
Metadata
Assignees
Labels
No labels