Open rchavesf opened 3 years ago
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
eh wait, this looks legit (will KIV), I check again later
Sometimes the method won't return the correct value.
How to reproduce:
Expected output:
Obtained result:
Code execution: https://ideone.com/k5IMXN