¿ìËÙÅÅÐòËã·¨µÄJAVAʵÏÖ
package Utils.Sort;
/**
*¿ìËÙÅÅÐò£¬ÒªÇó´ýÅÅÐòµÄÊý×é±ØÐëʵÏÖComparable½Ó¿Ú
*/
public class QuickSort implements SortStrategy
{
private static final int CUTOFF = 3; //µ±ÔªËØÊý´óÓÚ´Ëֵʱ²ÉÓÿìËÙÅÅÐò
/**
*ÀûÓÿìËÙÅÅÐòËã·¨¶ÔÊý×éobj½øÐÐÅÅÐò£¬ÒªÇó´ýÅÅÐòµÄÊý×é±ØÐëʵÏÖÁËComparable½Ó¿Ú
*/
public void sort(Comparable[] obj)
{
if (obj == null)
{
throw new NullPointerException("The argument can not be null!");
}
quickSort(obj, 0, obj.length - 1);
}
/**
*¶ÔÊý×éobj¿ìËÙÅÅÐò
*@param obj¡¡´ýÅÅÐòµÄÊý×é
*@param left Êý×éµÄϽç
*@param right Êý×éµÄÉϽç
*/
private void quickSort(Comparable[] obj, int left, int right)
{
if (left + CUTOFF > right)
{
&
Ïà¹ØÎĵµ£º
¡ñÒÑÖªÔ²µÄÃæ»ýArea=π*r*r£¬Çó°ë¾¶r¡£
import javax.swing.JOptionPane;
public class T6 {
public static void main(String args[]) {
String s = JOptionPane.showInputDialog("ÇëÊäÈëÔ²Ãæ»ý£º");
double Area = Double.parseDouble(s);
double r;
r = Math.sqrt(Area / M ......
JavaÖÐͨ¹ýimplements SerializableÀ´ÊµÏÖ¶ÔÏóµÄÐòÁл¯¡£ÆäʵSerializable½Ó¿ÚÖв¢Ã»ÓÐÐèҪʵÏֵķ½·¨£¬×¢Ã÷ij¸öÀàimplements SerializableÖ»ÊÇΪÁ˱êʶ»ò±íÃ÷Õâ¸öÀà¿ÉÒÔ±»ÐòÁл¯¡£
ÄÇôʲôÊÇÐòÁл¯ÄØ£¬ÐòÁл¯ÓÖÓÐʲô×÷ÓÃÄØ£¿
Ò»¸öÀ࣬»ò ......
ÊÂÎñ´¦ÀíÊÇÆóÒµÓ¦ÓÃÐèÒª½â¾öµÄ×îÖ÷ÒªµÄÎÊÌâÖ®Ò»¡£J2EEͨ¹ýJTAÌṩÁËÍêÕûµÄÊÂÎñ¹ÜÀíÄÜÁ¦£¬°üÀ¨¶à¸öÊÂÎñÐÔ×ÊÔ´µÄ¹ÜÀíÄÜÁ¦¡£µ«ÊǴ󲿷ÖÓ¦Óö¼ÊÇÔËÐÐÔÚµ¥Ò»µÄÊÂÎñÐÔ×ÊÔ´Ö®ÉÏ£¨Ò»¸öÊý¾Ý¿â£©£¬ËûÃDz¢²»ÐèҪȫ¾ÖÐÔµÄÊÂÎñ·þÎñ¡£±¾µØÊÂÎñ·þÎñÒÑÈ»×ã¹»(±ÈÈçJDBCÊÂÎñ¹ÜÀí£©¡£
±¾ÎIJ¢²»ÌÖÂÛÓ¦¸Ã²ÉÓúÎÖÖÊÂÎñ´ ......
package Utils.Sort;
/**
*ÀûÓÃðÅÝÅÅÐò·¨¶ÔÊý×éÅÅÐò£¬Êý×éÖÐÔªËرØÐëʵÏÖÁËComparable½Ó¿Ú¡£
*/
public class BubbleSort implements SortStrategy
{
/**
*¶ÔÊý×éobjÖеÄÔªËØÒÔðÅÝÅÅÐòËã·¨½øÐÐÅÅÐò
......