Java,java Official website _php Tutorial

Source: Internet
Author: User

Java,java official website


Java


        int[] array1 = {1,3,5,7,9,10,2,15,154,10,2,188,200};//defines an array with the contents of a chaotic size        intindex = 0;//defines the position of a maximum or minimum value        intKeyValue = 0;//define a maximum or minimum value        inttemp = 0;//defining a temporary storage variable         for(inti=0;i//loop all data sequentiallyindex = i;//assigns the I position to indexKeyValue = Array1[index];//assigns the value of the I position to KeyValue             for(inty=i;y//loop all the variables again, but this time the length starts with the length I, the maximum length is unchanged                if(Array1[y] < KeyValue) {//if the value of the loop to is less than the I positionindex = y;//position redefined as current positionKeyValue = Array1[y];//The minimum value is the current position}} Temp= Array1[i];//assigns the value of the I position to the temporary variable (maximum)Array1[i] = Array1[index];//redefine the I position as the index (minimum) positionArray1[index] = temp;//redefine the maximum value to the index position for the exchange process        }         for(intP=0;p) {System.out.print (array1[p]+" "); }
 Php/*Select sort:: Sort from small to large for arrays*/$array=Array(2, 100, 3, 50, 48, 99, 502, 30, 27, 15, 16, 300, 11, 9, 5, 4, 42); for($i= 0;$i<Count($array);$i++) {    $index=$i;//set Index to the current loop step    $keyValue=$array[$index];//sets the minimum value to the current     for($y=$i;$y<Count($array);$y++) {        if($array[$y] <$keyValue){//if the rest of the data is looped, there is a smaller value than I            $index=$y;//the index position at which the minimum value is recorded            $keyValue=$array[$index];//set minimum value to the value of the minimum index position        }    }    $temp=$array[$i];//assigns the value of the current loop to a temporary variable (maximum value)    $array[$i] =$array[$index];//assigns the minimum value to the current position    $array[$index] =$temp;//fills the position of the minimum value with the maximum value} Print_r($array);?>


What is + = in Java


What is Java?

Java is an object-oriented programming language that can compose cross-platform applications, and is a generic term for the Java programming language and Java platform (ie, javase, EE, javame), introduced by Sun Microsystems Corporation in May 1995. Java technology, with its versatility, efficiency, platform portability, and security, is widely used in personal PCs, data centers, game consoles, science supercomputers, mobile phones, and the Internet, while owning the world's largest developer professional community.

http://www.bkjia.com/PHPjc/827775.html www.bkjia.com true http://www.bkjia.com/PHPjc/827775.html techarticle Java,java official website Java int [] array1 = {1,3,5,7,9,10,2,15,154,10,2,188,200};//define an array with the contents of the chaotic size int index = 0;//define a maximum or minimum value The position of ...

  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.