The java. util. Arrays class provides several static methods for sorting Arrays. For example, use Arrays. sort (), input the array as a parameter, and return the sorted array. In java, we can also use ascending or descending or custom comparator for
/* Use arrays class sort () array elements in ascending descending order* * @Author: MO Smile scholar* @Version: 2010-1-2 V1.0*/Import Java.util.Arrays;
Class Sortdemo{public static void Main (string[] args){Int[] vec={0,15,-14,45,20,70};Arrays.sort
Sort the array values. in addition to the various sorting methods taught by the instructor, our php will directly give you a function rsort (), which is very simple to use, but only suitable for arrays. Rsort (array
Sort the array values. in
Php arsort array sort in descending order
Arsort sorts arrays in descending order and maintains the index relationship.
Basic syntax
Bool arsort (array & $ array [, int $ sort_flags = SORT_REGULAR])
This function sorts the array in descending order.
/** Copyright and version Declaration of the program* Copyright (c) 2011, a student from the computer College of Yantai University* All Rights Reserved.* File Name:* Author: Zhang chuanxin* Completion date: January 1, September 22, 2012* Version No.:
Sort the array values. In addition to the various sorting methods taught by the teacher, php will directly give you a function rsort (), which is very simple to use, but only suitable for arrays.
Rsort (array, sorttype)
Parameter descriptionArray is
Java interview question: if an array [2, 4, 6, 2,] is known, sort the Array (in descending order, the tool class cannot be used for sorting) and create two threads to output the sorted array alternately, thread name customization,
Package com. swift;
This article briefly introduces how php uses its own functions to sort the element values of arrays in descending order. For more information, see rsort () the function sorts the elements of the array in reverse order by key value, which is similar
2015 Huawei trial-input an integer array and a sorting ID to sort the elements in ascending or descending order. 2015 Huawei
Interface Description
Prototype:
Void sortIntegerArray (Integer [] pIntegerArray, int iSortFlag );
Input parameters:
Integer
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.