例如一些数组 {2,8,9,10,21,32,1,6,3...} 第一个 child 取(数据大小/2)并排序 第二个智利采用(数据大小/2)并在合并 2 个子数据后进行排序,并为我们提供排序后的完整数据,是否可以使用某些算法?
最佳答案
是的,实际上存在很多并行排序算法。
许多不同并行排序算法的一些有趣链接:
- A Library of Parallel Algorithms
- Computer Programming Algorithms Directory
- Sequential and parallel sorting algorithms
一些实现:
但我建议你用 parallel sorting algorithms 搜索谷歌获取更多信息。
关于c - 我如何在 c 中使用 fork() 对一个包含 2 个子项的数组进行排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2540120/