arrayscomplexityquestions
when do two pointers beat a prefix sum?
Anonymous
For a sorted array and a target sum, two pointers can scan in O(n). Prefix sums are handy for many range-sum queries. Which situation would make you choose one over the other?
0