日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSArrays

Arrays

成都網(wǎng)站建設哪家好,找成都創(chuàng)新互聯(lián)公司!專注于網(wǎng)頁設計、網(wǎng)站建設、微信開發(fā)、微信小程序、集團企業(yè)網(wǎng)站制作等服務項目。核心團隊均擁有互聯(lián)網(wǎng)行業(yè)多年經(jīng)驗,服務眾多知名企業(yè)客戶;涵蓋的客戶類型包括:墻體彩繪等眾多領域,積累了大量豐富的經(jīng)驗,同時也獲得了客戶的一致贊美!

java.lang.Object

|---java.util.Arrays

public class Arrays
extends Object

此類包含用于操作數(shù)組(例如排序和搜索)的各種方法。 此類還包含一個允許將數(shù)組視為列表的靜態(tài)工廠。

如果指定的數(shù)組引用為空,則此類中的方法都會拋出 NullPointerException,除非另有說明。

此類中包含的方法的文檔包括實現(xiàn)的簡要說明。 此類描述應被視為實現(xiàn)說明,而不是規(guī)范的一部分。 只要遵守規(guī)范本身,實現(xiàn)者應該可以隨意替換其他算法。 (例如,sort(Object[]) 使用的算法不必是 MergeSort,但它必須是穩(wěn)定的。)

此類是 Java 集合框架的成員。

方法總結(jié)

修飾符和類型 方法 描述
static  ListasList(T... a)返回由指定數(shù)組支持的固定大小的列表。
static intbinarySearch(byte[] a, byte key)使用二進制搜索算法在指定的字節(jié)數(shù)組中搜索指定的值。
static intbinarySearch(byte[] a, int fromIndex, int toIndex, byte key)使用二進制搜索算法在指定字節(jié)數(shù)組的范圍內(nèi)搜索指定值。
static intbinarySearch(char[] a, char key)使用二進制搜索算法在指定的字符數(shù)組中搜索指定的值。
static intbinarySearch(char[] a, int fromIndex, int toIndex, char key)使用二進制搜索算法在指定字符數(shù)組的范圍內(nèi)搜索指定值。
static intbinarySearch(double[] a, double key)使用二進制搜索算法在指定的雙精度數(shù)組中搜索指定的值。
static intbinarySearch(double[] a, int fromIndex, int toIndex, double key)使用二分搜索算法在指定的雙精度數(shù)組范圍內(nèi)搜索指定值。
static intbinarySearch(float[] a, float key)使用二進制搜索算法在指定的浮點數(shù)數(shù)組中搜索指定的值。
static intbinarySearch(float[] a, int fromIndex, int toIndex, float key)使用二分搜索算法在指定浮點數(shù)數(shù)組的范圍內(nèi)搜索指定值。
static intbinarySearch(int[] a, int key)使用二進制搜索算法在指定的整數(shù)數(shù)組中搜索指定的值。
static intbinarySearch(int[] a, int fromIndex, int toIndex, int key)使用二進制搜索算法在指定整數(shù)數(shù)組的范圍內(nèi)搜索指定值。
static intbinarySearch(long[] a, int fromIndex, int toIndex, long key)使用二進制搜索算法在指定的 long 數(shù)組的范圍內(nèi)搜索指定值。
static intbinarySearch(long[] a, long key)使用二進制搜索算法在指定的 long 數(shù)組中搜索指定的值。
static intbinarySearch(short[] a, int fromIndex, int toIndex, short key)使用二分搜索算法在指定的 short 數(shù)組的范圍內(nèi)搜索指定的值。
static intbinarySearch(short[] a, short key)使用二分搜索算法在指定的 short 數(shù)組中搜索指定的值。
static intbinarySearch(Object[] a, int fromIndex, int toIndex, Object key)使用二分搜索算法在指定數(shù)組的范圍內(nèi)搜索指定對象。
static intbinarySearch(Object[] a, Object key)使用二分搜索算法在指定數(shù)組中搜索指定對象。
static  intbinarySearch(T[] a, int fromIndex, int toIndex, T key, Comparator c)使用二分搜索算法在指定數(shù)組的范圍內(nèi)搜索指定對象。
static  intbinarySearch(T[] a, T key, Comparator c)使用二分搜索算法在指定數(shù)組中搜索指定對象。
static boolean[]copyOf(boolean[] original, int newLength)復制指定的數(shù)組,用 false 截斷或填充(如果需要),使副本具有指定的長度。
static byte[]copyOf(byte[] original, int newLength)復制指定的數(shù)組,用零截斷或填充(如有必要),以便副本具有指定的長度。
static char[]copyOf(char[] original, int newLength)復制指定的數(shù)組,用空字符截斷或填充(如有必要),使副本具有指定的長度。
static double[]copyOf(double[] original, int newLength)復制指定的數(shù)組,用零截斷或填充(如有必要),以便副本具有指定的長度。
static float[]copyOf(float[] original, int newLength)復制指定的數(shù)組,用零截斷或填充(如有必要),以便副本具有指定的長度。
static int[]copyOf(int[] original, int newLength)復制指定的數(shù)組,用零截斷或填充(如有必要),以便副本具有指定的長度。
static long[]copyOf(long[] original, int newLength)復制指定的數(shù)組,用零截斷或填充(如有必要),以便副本具有指定的長度。
static short[]copyOf(short[] original, int newLength)復制指定的數(shù)組,用零截斷或填充(如有必要),以便副本具有指定的長度。
static  T[]copyOf(T[] original, int newLength)復制指定的數(shù)組,截斷或填充空值(如有必要),使副本具有指定的長度。
static  T[]copyOf(U[] original, int newLength, Class newType)復制指定的數(shù)組,截斷或填充空值(如有必要),使副本具有指定的長度。
static boolean[]copyOfRange(boolean[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static byte[]copyOfRange(byte[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static char[]copyOfRange(char[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static double[]copyOfRange(double[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static float[]copyOfRange(float[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static int[]copyOfRange(int[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static long[]copyOfRange(long[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static short[]copyOfRange(short[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static  T[]copyOfRange(T[] original, int from, int to)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static  T[]copyOfRange(U[] original, int from, int to, Class newType)將指定數(shù)組的指定范圍復制到新數(shù)組中。
static booleandeepEquals(Object[] a1, Object[] a2)如果兩個指定的數(shù)組彼此深度相等,則返回 true。
static intdeepHashCode(Object[] a)根據(jù)指定數(shù)組的“深層內(nèi)容”返回哈希碼。
static StringdeepToString(Object[] a)返回指定數(shù)組的“深層內(nèi)容”的字符串表示形式。
static booleanequals(boolean[] a, boolean[] a2)如果兩個指定的布爾值數(shù)組彼此相等,則返回 true。
static booleanequals(byte[] a, byte[] a2)如果兩個指定的字節(jié)數(shù)組彼此相等,則返回 true。
static booleanequals(char[] a, char[] a2)如果兩個指定的字符數(shù)組彼此相等,則返回 true。
static booleanequals(double[] a, double[] a2)如果兩個指定的雙精度數(shù)組彼此相等,則返回 true。
static booleanequals(float[] a, float[] a2)如果兩個指定的浮點數(shù)組彼此相等,則返回 true。
static booleanequals(int[] a, int[] a2)如果兩個指定的 int 數(shù)組彼此相等,則返回 true。
static booleanequals(long[] a, long[] a2)如果兩個指定的 long 數(shù)組彼此相等,則返回 true。
static booleanequals(short[] a, short[] a2)如果兩個指定的 short 數(shù)組彼此相等,則返回 true。
static booleanequals(Object[] a, Object[] a2)如果兩個指定的 Objects 數(shù)組彼此相等,則返回 true。
static voidfill(boolean[] a, boolean val)將指定的布爾值分配給指定的布爾數(shù)組的每個元素。
static voidfill(boolean[] a, int fromIndex, int toIndex, boolean val)將指定的布爾值分配給指定布爾數(shù)組的指定范圍的每個元素。
static voidfill(byte[] a, byte val)將指定的字節(jié)值分配給指定字節(jié)數(shù)組的每個元素。
static voidfill(byte[] a, int fromIndex, int toIndex, byte val)將指定的字節(jié)值分配給指定字節(jié)數(shù)組的指定范圍的每個元素。
static voidfill(char[] a, char val)將指定的 char 值分配給指定的 char 數(shù)組的每個元素。
static voidfill(char[] a, int fromIndex, int toIndex, char val)將指定的 char 值分配給指定字符數(shù)組的指定范圍的每個元素。
static voidfill(double[] a, double val)將指定的 double 值分配給指定的 double 數(shù)組的每個元素。
static voidfill(double[] a, int fromIndex, int toIndex, double val)將指定的 double 值分配給指定的 double 數(shù)組的指定范圍內(nèi)的每個元素。
static voidfill(float[] a, float val)將指定的浮點值分配給指定浮點數(shù)組的每個元素。
static voidfill(float[] a, int fromIndex, int toIndex, float val)將指定的浮點值分配給指定浮點數(shù)組的指定范圍的每個元素。
static voidfill(int[] a, int val)將指定的 int 值分配給指定的 int 數(shù)組的每個元素。
static voidfill(int[] a, int fromIndex, int toIndex, int val)將指定的 int 值分配給指定 int 數(shù)組的指定范圍的每個元素。
static voidfill(long[] a, int fromIndex, int toIndex, long val)將指定的 long 值分配給指定 long 數(shù)組的指定范圍的每個元素。
static voidfill(long[] a, long val)將指定的 long 值分配給指定的 long 數(shù)組的每個元素。
static voidfill(short[] a, int fromIndex, int toIndex, short val)將指定的 short 值分配給指定的 short 數(shù)組的指定范圍的每個元素。
static voidfill(short[] a, short val)將指定的 short 值分配給指定的 short 數(shù)組的每個元素。
static voidfill(Object[] a, int fromIndex, int toIndex, Object val)將指定的 Object 引用分配給指定的 Objects 數(shù)組的指定范圍內(nèi)的每個元素。
static voidfill(Object[] a, Object val)將指定的 Object 引用分配給指定的 Objects 數(shù)組的每個元素。
static inthashCode(boolean[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(byte[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(char[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(double[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(float[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(int[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(long[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(short[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static inthashCode(Object[] a)根據(jù)指定數(shù)組的內(nèi)容返回哈希碼。
static voidparallelPrefix(double[] array, int fromIndex, int toIndex, DoubleBinaryOperator op)對數(shù)組的給定子范圍執(zhí)行 [parallelPrefix(double],java.util.function.DoubleBinaryOperator)。
static voidparallelPrefix(double[] array, DoubleBinaryOperator op)使用提供的函數(shù)并行累積給定數(shù)組的每個元素。
static voidparallelPrefix(int[] array, int fromIndex, int toIndex, IntBinaryOperator op)對數(shù)組的給定子范圍執(zhí)行 [parallelPrefix(int],java.util.function.IntBinaryOperator)。
static voidparallelPrefix(int[] array, IntBinaryOperator op)使用提供的函數(shù)并行累積給定數(shù)組的每個元素。
static voidparallelPrefix(long[] array, int fromIndex, int toIndex, LongBinaryOperator op)對數(shù)組的給定子范圍執(zhí)行 [parallelPrefix(long],java.util.function.LongBinaryOperator)。
static voidparallelPrefix(long[] array, LongBinaryOperator op)使用提供的函數(shù)并行累積給定數(shù)組的每個元素。
static  voidparallelPrefix(T[] array, int fromIndex, int toIndex, BinaryOperator op)對數(shù)組的給定子范圍執(zhí)行 [parallelPrefix(java.lang.Object],java.util.function.BinaryOperator)。
static  voidparallelPrefix(T[] array, BinaryOperator op)使用提供的函數(shù)并行累積給定數(shù)組的每個元素。
static voidparallelSetAll(double[] array, IntToDoubleFunction generator)使用提供的生成器函數(shù)并行設置指定數(shù)組的所有元素來計算每個元素。
static voidparallelSetAll(int[] array, IntUnaryOperator generator)使用提供的生成器函數(shù)并行設置指定數(shù)組的所有元素來計算每個元素。
static voidparallelSetAll(long[] array, IntToLongFunction generator)使用提供的生成器函數(shù)并行設置指定數(shù)組的所有元素來計算每個元素。
static  voidparallelSetAll(T[] array, IntFunction generator)使用提供的生成器函數(shù)并行設置指定數(shù)組的所有元素來計算每個元素。
static voidparallelSort(byte[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(byte[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static voidparallelSort(char[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(char[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static voidparallelSort(double[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(double[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static voidparallelSort(float[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(float[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static voidparallelSort(int[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(int[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static voidparallelSort(long[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(long[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static voidparallelSort(short[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidparallelSort(short[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按數(shù)字升序排序。
static >voidparallelSort(T[] a)根據(jù)其元素的 Comparable 對指定的對象數(shù)組進行升序排序。
static >voidparallelSort(T[] a, int fromIndex, int toIndex)根據(jù)其元素的 Comparable 對指定對象數(shù)組的指定范圍進行升序排序。
static  voidparallelSort(T[] a, int fromIndex, int toIndex, Comparator cmp)根據(jù)指定比較器的順序?qū)χ付▽ο髷?shù)組的指定范圍進行排序。
static  voidparallelSort(T[] a, Comparator cmp)根據(jù)指定比較器產(chǎn)生的順序?qū)χ付ǖ膶ο髷?shù)組進行排序。
static voidsetAll(double[] array, IntToDoubleFunction generator)設置指定數(shù)組的所有元素,使用提供的生成器函數(shù)計算每個元素。
static voidsetAll(int[] array, IntUnaryOperator generator)設置指定數(shù)組的所有元素,使用提供的生成器函數(shù)計算每個元素。
static voidsetAll(long[] array, IntToLongFunction generator)設置指定數(shù)組的所有元素,使用提供的生成器函數(shù)計算每個元素。
static  voidsetAll(T[] array, IntFunction generator)設置指定數(shù)組的所有元素,使用提供的生成器函數(shù)計算每個元素。
static voidsort(byte[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(byte[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(char[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(char[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(double[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(double[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(float[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(float[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(int[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(int[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(long[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(long[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(short[] a)將指定的數(shù)組按數(shù)字升序排序。
static voidsort(short[] a, int fromIndex, int toIndex)將數(shù)組的指定范圍按升序排序。
static voidsort(Object[] a)根據(jù)其元素的 Comparable 對指定的對象數(shù)組進行升序排序。
static voidsort(Object[] a, int fromIndex, int toIndex)根據(jù)其元素的 Comparable 對指定對象數(shù)組的指定范圍進行升序排序。
static  voidsort(T[] a, int fromIndex, int toIndex, Comparator c)根據(jù)指定比較器的順序?qū)χ付▽ο髷?shù)組的指定范圍進行排序。
static  voidsort(T[] a, Comparator c)根據(jù)指定比較器產(chǎn)生的順序?qū)χ付ǖ膶ο髷?shù)組進行排序。
static Spliterator.OfDoublespliterator(double[] array)返回一個 Spliterator.OfDouble 覆蓋所有指定的數(shù)組。
static Spliterator.OfDoublespliterator(double[] array, int startInclusive, int endExclusive)返回一個 Spliterator.OfDouble 覆蓋指定數(shù)組的指定范圍。
static Spliterator.OfIntspliterator(int[] array)返回一個 Spliterator.OfInt 覆蓋所有指定的數(shù)組。
static Spliterator.OfIntspliterator(int[] array, int startInclusive, int endExclusive)返回一個 Spliterator.OfInt 覆蓋指定數(shù)組的指定范圍。
static Spliterator.OfLongspliterator(long[] array)返回一個 Spliterator.OfLong 覆蓋所有指定的數(shù)組。
static Spliterator.OfLongspliterator(long[] array, int startInclusive, int endExclusive)返回一個 Spliterator.OfLong 覆蓋指定數(shù)組的指定范圍。
static  Spliteratorspliterator(T[] array)返回一個涵蓋所有指定數(shù)組的 Spliterator。
static  Spliteratorspliterator(T[] array, int startInclusive, int endExclusive)返回一個Spliterator,覆蓋指定數(shù)組的指定范圍。
static DoubleStreamstream(double[] array)返回以指定數(shù)組為源的順序 DoubleStream。
static DoubleStreamstream(double[] array, int startInclusive, int endExclusive)返回以指定數(shù)組的指定范圍作為源的順序 DoubleStream。
static IntStreamstream(int[] array)返回以指定數(shù)組作為源的順序 IntStream。
static IntStreamstream(int[] array, int startInclusive, int endExclusive)返回以指定數(shù)組的指定范圍作為源的順序 IntStream。
static LongStreamstream(long[] array)返回以指定數(shù)組為源的順序 LongStream。
static LongStreamstream(long[] array, int startInclusive, int endExclusive)返回以指定數(shù)組的指定范圍作為源的順序 LongStream。
static  Streamstream(T[] array)返回以指定數(shù)組為源的順序流。
static  Streamstream(T[] array, int startInclusive, int endExclusive)返回以指定數(shù)組的指定范圍作為源的順序流。
static StringtoString(boolean[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(byte[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(char[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(double[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(float[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(int[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(long[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(short[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
static StringtoString(Object[] a)返回指定數(shù)組內(nèi)容的字符串表示形式。
從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

方法詳情

sort

public static void sort(int[] a)

將指定的數(shù)組按數(shù)字升序排序。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(int[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

sort

public static void sort(long[] a)

將指定的數(shù)組按數(shù)字升序排序。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(long[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

sort

public static void sort(short[] a)

將指定的數(shù)組按數(shù)字升序排序。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(short[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

sort

public static void sort(char[] a)

將指定的數(shù)組按數(shù)字升序排序。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(char[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

sort

public static void sort(byte[] a)

將指定的數(shù)組按數(shù)字升序排序。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(byte[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

sort

public static void sort(float[] a)

將指定的數(shù)組按數(shù)字升序排序。

< 關系不提供所有浮點值的總順序:-0.0f == 0.0f 為真,并且 Float.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Float#compareTo 方法施加的總順序:-0.0f 被視為小于值 0.0f,F(xiàn)loat.NaN 被視為大于任何其他值,并且所有 Float.NaN 值被視為相等。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(float[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

< 關系不提供所有浮點值的總順序:-0.0f == 0.0f 為真,并且 Float.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Float#compareTo 方法施加的總順序:-0.0f 被視為小于值 0.0f,F(xiàn)loat.NaN 被視為大于任何其他值,并且所有 Float.NaN 值被視為相等。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

sort

public static void sort(double[] a)

將指定的數(shù)組按數(shù)字升序排序。

< 關系不提供所有雙精度值的總順序:-0.0d == 0.0d 為真,并且 Double.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Double#compareTo 方法施加的總順序:-0.0d 被視為小于值 0.0d,Double.NaN 被視為大于任何其他值,并且所有 Double.NaN 值被視為相等。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

sort

public static void sort(double[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

< 關系不提供所有雙精度值的總順序:-0.0d == 0.0d 為真,并且 Double.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Double#compareTo 方法施加的總順序:-0.0d 被視為小于值 0.0d,Double.NaN 被視為大于任何其他值,并且所有 Double.NaN 值被視為相等。

實施說明:排序算法是 Vladimir Yaroslavskiy、Jon Bentley 和 Joshua Bloch 的 Dual-Pivot Quicksort。 該算法在許多數(shù)據(jù)集上提供 O(n log(n)) 性能,導致其他快速排序降低到二次性能,并且通常比傳統(tǒng)的(單軸)快速排序?qū)崿F(xiàn)更快。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(byte[] a)

將指定的數(shù)組按數(shù)字升序排序。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(byte[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(char[] a)

將指定的數(shù)組按數(shù)字升序排序。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(char[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(short[] a)

將指定的數(shù)組按數(shù)字升序排序。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(short[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(int[] a)

將指定的數(shù)組按數(shù)字升序排序。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(int[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(long[] a)

將指定的數(shù)組按數(shù)字升序排序。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(long[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(float[] a)

將指定的數(shù)組按數(shù)字升序排序。

< 關系不提供所有浮點值的總順序:-0.0f == 0.0f 為真,并且 Float.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Float#compareTo 方法施加的總順序:-0.0f 被視為小于值 0.0f,F(xiàn)loat.NaN 被視為大于任何其他值,并且所有 Float.NaN 值被視為相等。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(float[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

< 關系不提供所有浮點值的總順序:-0.0f == 0.0f 為真,并且 Float.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Float#compareTo 方法施加的總順序:-0.0f 被視為小于值 0.0f,F(xiàn)loat.NaN 被視為大于任何其他值,并且所有 Float.NaN 值被視為相等。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static void parallelSort(double[] a)

將指定的數(shù)組按數(shù)字升序排序。

< 關系不提供所有雙精度值的總順序:-0.0d == 0.0d 為真,并且 Double.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Double#compareTo 方法施加的總順序:-0.0d 被視為小于值 0.0d,Double.NaN 被視為大于任何其他值,并且所有 Double.NaN 值被視為相等。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

parallelSort

public static void parallelSort(double[] a, int fromIndex, int toIndex)

將數(shù)組的指定范圍按數(shù)字升序排序。 要排序的范圍從索引 fromIndex(含)延伸到索引 toIndex(不含)。 如果 fromIndex == toIndex,則要排序的范圍為空。

< 關系不提供所有雙精度值的總順序:-0.0d == 0.0d 為真,并且 Double.NaN 值比較不小于、大于或等于任何值,甚至它本身。 此方法使用 Double#compareTo 方法施加的總順序:-0.0d 被視為小于值 0.0d,Double.NaN 被視為大于任何其他值,并且所有 Double.NaN 值被視為相等。

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素的索引,排他性

Throws:

Throw名稱 Throw描述
IllegalArgumentException如果 fromIndex > toIndex
ArrayIndexOutOfBoundsException如果 fromIndex < 0 或 toIndex > a.length

parallelSort

public static > void parallelSort(T[] a)

根據(jù)其元素的 Comparable 對指定的對象數(shù)組進行升序排序。 數(shù)組中的所有元素都必須實現(xiàn) Comparable 接口。 此外,數(shù)組中的所有元素必須相互可比較(即,e1.compareTo(e2) 不得為數(shù)組中的任何元素 e1 和 e2 拋出 ClassCastException)。

這種排序保證是穩(wěn)定的:相同的元素不會因為排序而重新排序。

類型參數(shù):

類型參數(shù)名稱 類型參數(shù)描述
T要排序的對象的類

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組

Throws:

Throw名稱 Throw描述
ClassCastException如果數(shù)組包含不可相互比較的元素(例如,字符串和整數(shù))
IllegalArgumentException(可選)如果發(fā)現(xiàn)數(shù)組元素的自然順序違反了 Comparable 合約

parallelSort

public static > void parallelSort(T[] a, int fromIndex, int toIndex)

根據(jù)其元素的 Comparable 對指定對象數(shù)組的指定范圍進行升序排序。 要排序的范圍從 index fromIndex(包括)擴展到 index toIndex(不包括)。 (如果fromIndex==toIndex,則要排序的范圍為空。)該范圍內(nèi)的所有元素都必須實現(xiàn)Comparable接口。 此外,此范圍內(nèi)的所有元素必須相互可比較(即,e1.compareTo(e2) 不得為數(shù)組中的任何元素 e1 和 e2 拋出 ClassCastException)。

這種排序保證是穩(wěn)定的:相同的元素不會因為排序而重新排序。

類型參數(shù):

類型參數(shù)名稱 類型參數(shù)描述
T要排序的對象的類

參數(shù):

參數(shù)名稱 參數(shù)描述
a要排序的數(shù)組
fromIndex要排序的第一個元素(包括)的索引
toIndex要排序的最后一個元素(不包括)的索引

Throws:

  • <menuitem id="ba2py"></menuitem>
    Throw名稱 Throw描述
    IllegalArgumentException如果 fromIndex > toIndex 或(可選)如果發(fā)現(xiàn)數(shù)組元素的
    本文名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSArrays
    網(wǎng)頁鏈接:http://www.dlmjj.cn/article/codcgoj.html