A good choice of parallel sorting algorithm to implement as homework?

I want to implement a fast algorithm for homework, but using parallel processing for this task. I heard that the parallel version of Quicksort is the best choice, but I'm not so sure ... maybe Heapsort is a good idea. Which algorithm do you think is best for a parallel environment and why?

+6
source share
7 answers

Quick sorting can split an unsorted list into two halves, but, unfortunately, the halves are not guaranteed anywhere even close. Thus, one machine (or half a cluster of machines) can get 20 records, and the other half can get 20 billion.

I can’t figure out how to make the hepatron work in parallel. This can be done, but a person who feels completely illogical.

Sort sort is the one that I think you need.

  • Each split is exactly 50% of the list, so it is easy to split between the processors.
  • , , , . , , , , .
  • , .
+6

- . .

+3

J , . , ( ).

, quicksort , , ( ) , .

, - , . , , , , .

+2

, .

1. N , N - //. .

2. N .

N , , . , heapsort, . 2 , , , , .

+1

:

- , : , , : .

: O (n log (n)), , , . , .

Youtube .

PS - , ... 3 .

+1

, ( , quicksort), , , . , .

0

, . , . . ( , 10 ) , 1.5x , IIRC.

Edit:

Most of the programming that I do is a number crunch, so I tend to think about sorting simple primitives. I still think parallel sorting is a bad idea for these cases. However, if you sort things that are expensive to compare, this answer does not apply.

0
source

All Articles