¼¸ÖÖ³£¼ûµÄÅÅÐòËã·¨µÄJAVAʵÏÖ
ÒÔO(n)µÄʱ¼äʵÏÖ¶ÔÕýÕûÊýµÄÅÅÐò¡£Ë¼Â·ÊÇ£º´Ó×îĩλ¿ªÊ¼£¬¶ÔÊý×éÖÐÿһ¸öÊýµÄµÚkλ½øÐмÆÊýÅÅÐò£¬Ö±µ½Åŵ½×î¸ßλΪֹ¡£
ȱµã£ºÖ»ÄܶÔÕýÕûÊý½øÐÐÅÅÐò£¬¶øÇÒÐèÒªÖªµÀ×î´óÕûÊýµÄ×î¸ßλ£¬Ê¹Ó÷¶Î§Ì«Ð¡¡£µ«ÕⲻʧΪһ¸öºÜÓÐȤµÄÅÅÐò£¬ÒòΪËüµß¸²Á˱ȽÏÅÅÐòµÄ´«Í³Ë¼Â·¡£
public static int[] radixSort(int[] inputs,int d){
for (int i = 1; i <= d; ++i)
inputs = countingSortForRadixSort(inputs, i);
return inputs;
}
private static int[] countingSortForRadixSort(int[] inputs,int digit){
int[] outputs = new int[inputs.length];
int[] middles = new int[10];
for (int i = 0; i < inputs.length ; ++i)
++middles[getDigitNumber(inputs[i],digit)];
for (int i = 1; i < middles.length; ++i)
middles[i] += middles[i-1];
for (int i = inputs.length-1; i >= 0; --i)
outputs[--middles[getDigitNumber(inputs[i],digit)]] = inputs[i];
return outputs;
}
private static int getDigitNumber(int no,int digit){
if (digit <= 0)
throw new IllegalArgumentException("digit can not be negitive or zero!");
return (int)((no/Math.pow(10,digit-1))%10);
}
Ïà¹ØÎĵµ£º
1. RabbitÁ÷ÃÜÂ루Rabbit Stream Cipher£©¼ò½é
RabbitÁ÷ÃÜÂëÊÇÓÉCryptico¹«Ë¾£¨http://www.cryptico.com£©Éè¼ÆµÄ£¬ÃÜÔ¿³¤¶È128룬
×î´ó¼ÓÃÜÏûÏ¢³¤¶ÈΪ264 Bytes£¬¼´16 TB£¬ÈôÏûÏ¢³¬¹ý¸Ã³¤¶È£¬ÔòÐèÒª¸ü»»ÃÜÔ¿¶ÔʣϵÄÏûÏ¢½øÐд¦Àí¡£ËüÊÇÄ¿Ç°°²È«ÐԽϸߣ¬¼Ó/½âÃÜËٶȱȽϸßЧµÄÁ÷ÃÜÂëÖ®Ò»£ ......
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ – ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í.
4.[http:/ ......
²»Öª²»¾õ×öÈí¼þÒѾ×öÁËÊ®Ä꣬Óгɹ¦µÄϲÔã¬Ò²ÓÐʧ°ÜµÄÍ´¿à£¬µ«×ܲ»¸Ò³Æ×Ô¼ºÊǸßÊÖ£¬ÒòΪºÍÎÒÐÄÄ¿ÖÐÕæÕýµÄ¸ßÊÖÃDZÈÆðÀ´£¬»¹²îµÄÌ«Ô¶¡£ÊÀ½çÉϲ¢Ã»ÓгÉΪ¸ßÊֵĽݾ¶£¬µ«Ò»Ð©»ù±¾ÔÔòÊÇ¿ÉÒÔ×ñѵġ£
¡¡¡¡1. ÔúʵµÄ»ù´¡¡£Êý¾Ý½á¹¹¡¢ÀëÉ¢Êýѧ¡¢±àÒëÔÀí£¬ÕâЩÊÇËùÓмÆËã»ú¿ÆѧµÄ»ù´¡£¬Èç¹û²»ÕÆÎÕËûÃÇ£¬ºÜÄÑд³ö¸ßˮƽµÄ ......
public class Path {
//get class absolute address
public String getPath() {
String classPath = getClass().getName();
if (classPath.indexOf(".") != -1) {
classPath = classPath.substring(classPath.lastIndexOf(".") + 1,
......