News for hackers. Stuff that matters.
Re:Copying data is wasteful, mutating data is dangerous by DarkWiiPlayer on Friday January 10, 2020 @04:23AM (#22009628)
What about lazy evaluation though? That could get the functions 2*A memory down to just A while still keeping the time O(n)¹

Of course, maybe the author just chose to limit this blog post to this one solution, but it wouldn't have hurt to at least mention some further optimizations :)

¹ And some O(1) data like the min and max values of the Array

There are no comments on this comment yet.