On Monday, 12 June 2017 at 01:02:58 UTC, helxi wrote:
Is it possible to sum an array in O(1)?

No.
If you want to sum the elements you have to at-least look at all the elements.
So it'll always be O(N).
it's the best you can do.
  • O(1) sum helxi via Digitalmars-d-learn
    • Re: O(1) sum Stefan Koch via Digitalmars-d-learn
    • Re: O(1) sum Ali Çehreli via Digitalmars-d-learn

Reply via email to