it.unimi.dsi.fastutil.Arrays.mergeSort()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中it.unimi.dsi.fastutil.Arrays.mergeSort()方法的一些代码示例,展示了Arrays.mergeSort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arrays.mergeSort()方法的具体详情如下:
包路径:it.unimi.dsi.fastutil.Arrays
类名称:Arrays
方法名:mergeSort

Arrays.mergeSort介绍

[英]Sorts the specified range of elements using the specified swapper and according to the order induced by the specified comparator using mergesort.

This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort. The sorting algorithm is an in-place mergesort that is significantly slower than a standard mergesort, as its running time is O(n (log n)2), but it does not allocate additional memory; as a result, it can be used as a generic sorting algorithm.
[中]使用指定的交换程序并根据使用mergesort的指定比较器产生的顺序对指定范围的元素进行排序。
这种排序保证是稳定的:相等的元素不会因排序而重新排序。排序算法是一种就地mergesort,它比标准mergesort慢得多,因为它的运行时间是O(n(logn)2),但它不分配额外的内存;因此,它可以用作通用排序算法。

代码示例

代码示例来源:origin: it.unimi.dsi/fastutil

mergeSort(from, mid, c, swapper);
mergeSort(mid, to, c, swapper);

代码示例来源:origin: AliView/AliView

mergeSort( from, mid, c, swapper );
mergeSort( mid, to, c, swapper );

相关文章