Skip to content

Commit 5778e56

Browse files
committed
getting next index to update BIT
1 parent b68589f commit 5778e56

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Fenwick_Tree/fenwickTree.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
T.C. to create - O(nlogn)
55
T.C. to update - O(logn)
66
T.C. to get prefix sum - O(logn)
7-
87
*/
98

109
public class fenwickTree {
@@ -17,7 +16,7 @@ public class fenwickTree {
1716
public void updateBinaryIndexedTree(int binaryIndexedTree[], int val, int index) {
1817
while (index < binaryIndexedTree.length) {
1918
binaryIndexedTree[index] += val; // adding to original value in node
20-
index = getIndex(index); // getting next index
19+
index = getNext(index); // getting next index
2120

2221
}
2322
}

0 commit comments

Comments
 (0)