JAVAÅÅÐò»ã×Ü
package com.softeem.jbs.lesson4;
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£©£»
* 2.½»»»ÅÅÐò£¨Ã°ÅÝÅÝÅÅÐò¡¢¿ìËÙÅÅÐò£©£»
* 3.Ñ¡ÔñÅÅÐò£¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò£©£»
* 4.¹é²¢ÅÅÐò£»
* 5.»ùÊýÅÅÐò¡£
*
* ¹ØÓÚÅÅÐò·½·¨µÄÑ¡Ôñ£º
* (1)Èôn½ÏС(Èçn≤50)£¬¿É²ÉÓÃÖ±½Ó²åÈë»òÖ±½ÓÑ¡ÔñÅÅÐò¡£
* ¡¡µ±¼Ç¼¹æÄ£½ÏСʱ£¬Ö±½Ó²åÈëÅÅÐò½ÏºÃ£»·ñÔòÒòΪֱ½ÓÑ¡ÔñÒƶ¯µÄ¼Ç¼ÊýÉÙÓÚÖ±½Ó²åÈË£¬Ó¦Ñ¡Ö±½ÓÑ¡ÔñÅÅÐòΪÒË¡£
* (2)ÈôÎļþ³õʼ״̬»ù±¾ÓÐÐò(Ö¸ÕýÐò)£¬ÔòӦѡÓÃÖ±½Ó²åÈË¡¢Ã°ÅÝ»òËæ»úµÄ¿ìËÙÅÅÐòΪÒË£»
* (3)Èôn½Ï´ó£¬ÔòÓ¦²ÉÓÃʱ¼ä¸´ÔÓ¶ÈΪO(nlgn)µÄÅÅÐò·½·¨£º¿ìËÙÅÅÐò¡¢¶ÑÅÅÐò»ò¹é²¢ÅÅÐò¡£
*
*/
public class SortTest {
/**
* ³õʼ»¯²âÊÔÊý×éµÄ·½·¨
* @return Ò»¸ö³õʼ»¯ºÃµÄÊý×é
*/
public int[] createArray() {
Random random = new Random();
int[] array = new int[10];
for (int i = 0; i < 10; i++) {
array[i] = random.nextInt(100) - random.nextInt(100);//Éú³ÉÁ½¸öËæ»úÊýÏà¼õ£¬±£Ö¤Éú³ÉµÄÊýÖÐÓиºÊý
}
System.out.println("==========ÔʼÐòÁÐ==========");
printArray(array);
return array;
}
/**
* ´òÓ¡Êý×éÖеÄÔªËص½¿ØÖÆ̨
* @param source
*/
public void printArray(int[] data) {
for (int i : data) {
System.out.print(i + " ");
}
System.out.println();
}
/**
* ½»»»Êý×éÖÐÖ¸¶¨µÄÁ½ÔªËصÄλÖÃ
* @param data
* @param x
* @param y
*/
private void swap(int[] data, int x, int y) {
int temp = data[x];
data[x] = data[y];
data[y] = temp;
}
/**
* ðÅÝÅÅÐò----½»»»ÅÅÐòµÄÒ»ÖÖ
* ·½·¨£ºÏàÁÚÁ½ÔªËؽøÐбȽϣ¬ÈçÓÐÐèÒªÔò½øÐн»»»£¬Ã¿Íê³ÉÒ»´ÎÑ»·¾Í½«×î´óÔªËØÅÅÔÚ×îºó£¨Èç´ÓСµ½´óÅÅÐò£©£¬ÏÂÒ»´ÎÑ
Ïà¹ØÎĵµ£º
public static void main(String[] args)
{
Integer[] arrInt = new Integer[6];
arrInt[0] = 123;
arrInt[1] = 3453;
arrInt[2] = 345;
arrInt[3] = 23;
arrInt[4] = 11;
arrInt[5] = 345;
int temp = 0;
for (int i ......
public class Migong {
private int gard[][]={ {1,1,1,1,0,1,1,1},
{0,0,0,1,1,1,1,1},
......
ÔÚAndroidµÄÓ¦ÓóÌÐò¿ª·¢ÖУ¬Í¨³£Ê¹ÓõÄÊÇJAVAÓïÑÔ£¬³ýÁËÐèÒªÊìϤJAVAÓïÑԵĻù´¡ÖªÊ¶Ö®Í⣬»¹ÐèÒªÁ˽âAndroidÌṩµÄÀ©Õ¹µÄJAVA¹¦ÄÜ¡£
ÔÚÒ»°ãµÄJAVAÓ¦ÓÃÖУ¬Èç¹ûÐèÓÃÒýÓûù´¡Àà¿â£¬Í¨³£ÐèҪʹÓÃÈçϵķ½Ê½£º
import
javax.swing.*;
ÒÔÉÏ´úÂë±íʾÁËÒýÓÃJAVAµÄGUI×é¼þSwing,javax.swing¼´JAVAÖеÄÒ»¸ö°ü¡£
androidÌá¹©Ò ......
ÔÚËùÓеÄJavaÊé¼®µ±ÖУ¬Æäʵ×î×îÓÐÓõģ¬²¢²»ÊÇO′reillyµÄ Java Serials£¬ÕæÕý×î×îÓÐÓô¦ÊÇJDKµÄÎĵµation£¡¼¸ºõÄãÏë»ñµÃµÄËùÓеÄ֪ʶÔÚÎĵµationÀïÃæÈ«²¿¶¼ÓУ¬ÆäÖÐ×îÖ÷ÒªµÄ²¿·Öµ±È»ÊÇJava»ù´¡Àà¿âµÄAPIÎĵµ£¬ÊÇ°´ÕÕpackageÀ´×éÖ¯µÄ£¬¶ÔÓÚÿһ¸öclass¶¼ÓÐÏêϸµÄ½âÊÍ£¬ËüµÄ¼Ì³Ð¹Øϵ£¬ÊÇ·ñʵÏÖÁËij¸ö½Ó¿Ú£¬Í¨³£ÓÃÔÚÄÄÐ ......