JAVAÅÅÐòËã·¨£¨·ÇÔ´´£©
JAVAÅÅÐòËã·¨£¨·ÇÔ´´£©
package Sort;
class Data {
Comparable key;
Object value;
public Data() {
}
public Data(Data data){
this.key=data.key;
this.value=data.value;
}
public Data(Comparable key,Object value){
this.key=key;
this.value=value;
}
public String toString(){
return "key="+key+";"+"value="+value+";"+"\n";
}
}
Insertion.java
package Sort;
public class InsertionSort {
public InsertionSort() {
}
//Ö±½Ó²åÈëÅÅÐò,´Óϱê1¿ªÊ¼
public static void straightInsertionSort(Data[] data) {
int i, j;
for (i = 2; i <data.length; i++) {
if (data[i].key.compareTo(data[i - 1].key) < 0) {
data[0] = data[i];//¸´ÖÆΪ¼àÊÓÉÚ
for (j = i - 1; data[0].key.compareTo(data[j].key) < 0; --j) {
data[j + 1] = data[j];//¼Ç¼ÓÒÒÆ
}
data[j + 1] = data[0];//²åÈë
}
}
}
//ÕÛ°ë²åÈëÅÅÐò,´Óϱê1¿ªÊ¼
public static void BinaryInsertionSort(Data[] data){
int i,j,low,high,mid;
for(i=2;i<data.length;i++){
if (data[i].key.compareTo(data[i - 1].key) < 0) {
&nb
Ïà¹ØÎĵµ£º
' ¡¡1¡¢FACTORY—×·MMÉÙ²»ÁËÇë³Ô·¹ÁË£¬Âóµ±À͵ļ¦³áºÍ¿ÏµÂ»ùµÄ¼¦³á¶¼ÊÇMM°®³ÔµÄ¶«Î÷£¬ËäÈ»¿ÚζÓÐËù²»Í¬£¬µ«²»¹ÜÄã´øMMÈ¥Âóµ±ÀÍ»ò¿ÏµÂ»ù£¬Ö»¹ÜÏò·þÎñԱ˵“À´Ëĸö¼¦³á”¾ÍÐÐÁË¡£Âóµ±ÀͺͿϵ»ù¾ÍÊÇÉú²ú¼¦³áµÄFactory
¡¡¡¡¹¤³§Ä£Ê½£º¿Í»§ÀàºÍ¹¤³§Àà·Ö¿ª¡£Ïû·ÑÕßÈκÎʱºòÐèҪijÖÖ²úÆ·£¬Ö»ÐèÏò¹¤³ ......
public static String StringFilter(String str) throws
PatternSyntaxException {
// Ö»ÔÊÐí×ÖĸºÍÊý×Ö
&nbs ......
result love(boy, girl)
{
if( boy.Óз¿() and boy.Óгµ() )
{
boy.set(nothing);
return girl.¼Þ¸ø(boy);
&n ......
JDBCÁ¬½ÓMySQL
¼ÓÔؼ°×¢²áJDBCÇý¶¯³ÌÐò
Class.forName("com.mysql.jdbc.Driver");
Class.forName("com.mysql.jdbc.Driver").newInstance();
JDBC URL ¶¨ÒåÇý¶¯³ÌÐòÓëÊý¾ÝÔ´Ö®¼äµÄÁ¬½Ó
±ê×¼Óï·¨£º
<protocol£¨Ö÷ҪͨѶÐÒ飩>:<subprotocol£¨´ÎҪͨѶÐÒ飬¼´Çý¶¯³ÌÐòÃû³Æ£©>:<da ......
ת £º http://jayzotion.javaeye.com/blog/404084
public class TestBinSearch {
/**
* @param args
*/
public ......