Little-Known Awesome Algorithms: Fenwick Trees – Rapidly Find Cumulative Frequen

http://www.swageroo.com/wordpress/little-known-awesome-algorithms-fenwick-range-trees-rapidly-find-cumulative-frequency-sums/


This is to solve range query problems. Questions can be like below

引用
Imagine that we are creating an analytics tool for a financials brokerage, where orders are coming in all the time. Let’s say we’re interested in knowing how many orders fall between a certain value (a range query), in real-time. Lets say that orders can fall between $0.01 and $5M, and we want to let our clients query at any given time how many orders have gone through so far that fall between any $x and $y.

你可能感兴趣的:(Algorithm)