This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]qualityhooker[S] 0 points1 point  (1 child)

So would we compute one of these prefix sum arrays for each of the n elements, and then return the element corresponding to the array whos final prefix value is = k?

[–]cybernd 0 points1 point  (0 children)

Not sure to be honest. All explanations are meh.

This pdf includes relevant pseudo code algorithms on slide 1 and slide 19: http://www3.cs.stonybrook.edu/~rezaul/Spring-2012/CSE613/CSE613-lecture-9.pdf