Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¼¸ÖÖ³£¼ûµÄÅÅÐòËã·¨µÄ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);
}


Ïà¹ØÎĵµ£º

RabbitÁ÷ÃÜÂëµÄJavaʵÏÖ

1. RabbitÁ÷ÃÜÂ루Rabbit Stream Cipher£©¼ò½é
      RabbitÁ÷ÃÜÂëÊÇÓÉCryptico¹«Ë¾£¨http://www.cryptico.com£©Éè¼ÆµÄ£¬ÃÜÔ¿³¤¶È128룬
×î´ó¼ÓÃÜÏûÏ¢³¤¶ÈΪ264 Bytes£¬¼´16 TB£¬ÈôÏûÏ¢³¬¹ý¸Ã³¤¶È£¬ÔòÐèÒª¸ü»»ÃÜÔ¿¶ÔʣϵÄÏûÏ¢½øÐд¦Àí¡£ËüÊÇÄ¿Ç°°²È«ÐԽϸߣ¬¼Ó/½âÃÜËٶȱȽϸßЧµÄÁ÷ÃÜÂëÖ®Ò»£ ......

JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾

1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ – ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í.
4.[http:/ ......

ÈçºÎÌá¸ß×Ô¼ºµÄJava±à³Ìˮƽ[תÔØ]

 ²»Öª²»¾õ×öÈí¼þÒѾ­×öÁËÊ®Ä꣬Óгɹ¦µÄϲÔã¬Ò²ÓÐʧ°ÜµÄÍ´¿à£¬µ«×ܲ»¸Ò³Æ×Ô¼ºÊǸßÊÖ£¬ÒòΪºÍÎÒÐÄÄ¿ÖÐÕæÕýµÄ¸ßÊÖÃDZÈÆðÀ´£¬»¹²îµÄÌ«Ô¶¡£ÊÀ½çÉϲ¢Ã»ÓгÉΪ¸ßÊֵĽݾ¶£¬µ«Ò»Ð©»ù±¾Ô­ÔòÊÇ¿ÉÒÔ×ñÑ­µÄ¡£
¡¡¡¡1. ÔúʵµÄ»ù´¡¡£Êý¾Ý½á¹¹¡¢ÀëÉ¢Êýѧ¡¢±àÒëÔ­Àí£¬ÕâЩÊÇËùÓмÆËã»ú¿ÆѧµÄ»ù´¡£¬Èç¹û²»ÕÆÎÕËûÃÇ£¬ºÜÄÑд³ö¸ßˮƽµÄ ......

»ñÈ¡java ÀàµÄ·¾¶

public class Path {
 //get class absolute address
 public String getPath() {
  String classPath = getClass().getName();
  if (classPath.indexOf(".") != -1) {
   classPath = classPath.substring(classPath.lastIndexOf(".") + 1,
     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ