O(1) sum

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 12 11:22:23 PDT 2017


On 06/11/2017 06:02 PM, helxi wrote:
> Is it possible to sum an array in O(1)?

It's possible to maintain the sum as elements are added and removed. 
Then, accessing it would be O(1).

Ali



More information about the Digitalmars-d-learn mailing list