Skip to content

goswamig/Fenwick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

A C++ implememtation of Fenwick tree which perform following two operations on a given array in O(logn) time

1. Find some from 0 to any given index i
   (This can be used to find sum between two interval)
  eg: getSum(fenwickTree, i);
   
2. Update an entry of array.
   array[i] += newVal;
   updateFW(fenwick, i, newVal);
   (This can be used to overwrite a value as well)
    prevVal = arra[i];
    array[i] = newVal;
    updateFW(fenwick, i, newVal-prevVal);

About

C++ Implementation of Fenwick Tree (Binary index tree)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages