top | item 43165825

(no title)

throwaway_1more | 1 year ago

Max is not like sum, you can just maintain one value over the window and update from new ones arriving immediately?

discuss

order

BoiledCabbage|1 year ago

Yes, but how do you update your max when you drop old values. That's the issue with max forming a monoid and not a group.

The whole point of the post is that this is easy to implement for sum, but is difficult for max. Posting how someone solves the problem for sum isn't really addressing anything new here.

throwaway_1more|1 year ago

If the value you dropped wasn't the max, no problem, if it was, you recompute over the window. It is amortized.