標籤:學習演算法過程中,肯定會遇到圖。因為比較熟悉java,所以習慣用java去實現一遍,但是我一直沒有找到樹和圖的資料結構的jar包,好遺憾。今天搜拓撲排序的實現,無意中發現了一個圖的Java實現【1】,很棒,方正比我自己的好很多,map的使用是個亮點:enum Color {WHITE, GRAY, BLACK}static class Vertex {private String name; 
標籤:hdu1867點擊開啟連結Problem DescriptionGenerally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as “asdf” and “sdfg”, the result of the addition between them is “asdfg”
標籤: public static final char UNDERLINE=‘_‘; public static String camelToUnderline(String param){ if (param==null||"".equals(param.trim())){ return ""; } int len=param.length(); StringBuilder sb=new
標籤:賦值運算子號 一元運算子 算術運算子 關係運算子 遞增與遞減運算子public class T { public static void main(String[] args) { int a = 3 , b = 3 ; // 定義兩個變數a和b int x = 6, y = 6 ; // 定義兩個變數x和y System.out.println("a = " + a) ;
標籤: 照例來說點廢話,願自己生一顆溫柔細膩的心,這樣女朋友也許一個眼神,一個微笑,我就知道如何做,可惜內心與外表一樣粗糙,這一生有幸認識她,願天下有情人終成眷屬。 迴圈鏈表,顧名思義迴圈就好了,所以建一個線性表之後,在尾指標之後.next=first就好了,照例先建一個結構體(類似於C語言的結構體,java裡面是類):class Person{ protected Person next; protected int data; public Person(int
標籤:範例一class Demo{ public int temp = 30; } public class T { public static void main(String[] args) { // TODO Auto-generated method stub Demo d1 = new Demo(); d1.temp = 50;
標籤:一、Date類在java.util包中定義了Date類,Date類本身使用非常簡單,直接輸出其執行個體化對象即可。public class T { public static void main(String[] args) { Date date = new Date(); System.out.println("當前日期:"+date); //當前日期:Thu May 16 23:00:57 CST 2013 }