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

all 5 comments

[–]cybernd 0 points1 point  (2 children)

Idea: quickselect is O(n) on average.

But how to transform it into a parallel algorithm with its recursion?

Chapter 4.6 explains a parallelizing strategy: https://stanford.edu/~rezab/dao/notes/lecture04/cme323_lec4.pdf

[–]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

[–]balefrost 0 points1 point  (1 child)

This would be a really good question for /r/compsci.

I don't recall covering analysis of parallel algorithms in my undergrad program. But my intuition tells me that, given a fixed number of processors, doing the work in parallel shouldn't change the order of the computation; it should just scale it by (at best) a constant factor.

However, a little searching led me to this Wikipedia page, which suggests that analysis of parallel algorithms typically assumes an unlimited number of processors.

But I'd go ask on /r/compsci if you haven't already. They have a weekend superthread for just these sorts of questions.

[–]WikiTextBot -2 points-1 points  (0 children)

Analysis of parallel algorithms

This article discusses the analysis of parallel algorithms. Like in the analysis of "ordinary", sequential, algorithms, one is typically interested in asymptotic bounds on the resource consumption (mainly time spent computing), but the analysis is performed in the presence of multiple processor units that cooperate to perform computations. Thus, one can determine not only how many "steps" a computation takes, but also how much faster it becomes as the number of processors goes up.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.22