Closed howsiwei closed 4 years ago
Noted @howsiwei , will let you populate this PR over weekend and review/merge in one go on Monday 13 Jul morning. Finalising ch9 content first.
The comment at
https://github.com/stevenhalim/cpbook-code/blob/666991eaa9c08d22228ae469710b1176b35cd35e/ch2/ourown/fenwicktree_ds.cpp#L84-L85
feels misleading since rupq.point_query(j)*j
is neither optimistic nor pessimistic, in the sense that it can be either large or smaller than the real value even if all values used in updates are positive.
In fact, I always view -purq.rsq(j)
as the main part and rupq.point_query(j)*j
as the offset.
Done with this PR for now. Will continue next weekend if free.
I will sync the writeup with your weekend contribution. Thanks. Getting close to full completion of OCaml translations.
Too lazy to create many PRs. So I'll just make all the changes here if that's ok. @stevenhalim you can review and/or merge this PR anytime. Any code that is pushed here is more or less finalized.