We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b68589f commit 5778e56Copy full SHA for 5778e56
Fenwick_Tree/fenwickTree.java
@@ -4,7 +4,6 @@
4
T.C. to create - O(nlogn)
5
T.C. to update - O(logn)
6
T.C. to get prefix sum - O(logn)
7
-
8
*/
9
10
public class fenwickTree {
@@ -17,7 +16,7 @@ public class fenwickTree {
17
16
public void updateBinaryIndexedTree(int binaryIndexedTree[], int val, int index) {
18
while (index < binaryIndexedTree.length) {
19
binaryIndexedTree[index] += val; // adding to original value in node
20
- index = getIndex(index); // getting next index
+ index = getNext(index); // getting next index
21
22
}
23
0 commit comments