I am now looking at my old school assignment and want to find the solution of a question.
Which sorting method is most suitable for parallel processing?
- Bubble sort
- Quick sort
- Merge sort
- Selection sort
I guess quick sort (or merge sort?) is the answer.
Am I correct?
I think Merge Sort would be the best answer here. Because the basic idea behind merge sort is to divide the problem into individual solutions.Solve them and Merge them.
Thats what we actually do in parallel processing too. Divide the whole problem into small unit statements to compute parallely and then join the results. Thanks
i think merge sort
you can divide the dataset and make parallel operations on them..
It is merge sort since the sorting is done on two sub arrays and they are compared and sorted at the end. these can be done in parallel
Just a couple of random remarks:
It depends completely on the method of parallelization. For multithreaded general computing, a merge sort provides pretty reliable load balancing and memory localization properties. For a large sorting network in hardware, a form of Batcher, Bitonic, or Shell sort is actually best if you want good O(log² n) performance.
Like merge sort, quicksort can also be easily parallelized due to its divide-and-conquer nature. Individual in-place partition operations are difficult to parallelize, but once divided, different sections of the list can be sorted in parallel.
One advantage of parallel quicksort over other parallel sort algorithms is that no synchronization is required. A new thread is started as soon as a sublist is available for it to work on and it does not communicate with other threads. When all threads complete, the sort is done.
http://en.wikipedia.org/wiki/Quicksort