📜  java 并行排序 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:35.799000             🧑  作者: Mango

代码示例1
//for big data we can use multiple threads for faster sorting
int[] arr={1,2,3,4,5,2,4};
//using parallelsort()
Arrays.parallelSort(arr);
//using stream
int[] arr=Arrays.stream(arr)
  .parallel()
  .sorted()
  .toArray();