]]>re: 鏈夌偣闅懼害鐨刯ava絎旇瘯棰?/title>http://www.tkk7.com/sandy/archive/2013/04/18/390916.html#398002灝忔槑灝忔槑Thu, 18 Apr 2013 01:32:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/18/390916.html#398002 The answer of question is b
b) If user doesn鈥檛 specify classpath, the JVM search the class from the current folder by default.
JVM doesn't search the class from the current folder by default.
]]>re: 鍥炴枃瀛楃涓茬殑鍒囧壊闂[鏈櫥褰昡http://www.tkk7.com/sandy/archive/2013/04/17/397689.html#397964HarryHarryWed, 17 Apr 2013 04:39:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/17/397689.html#397964 def isPelindrome(l:String):Boolean = { val fhalf = l.take(l.length/2) val shalf = l.takeRight(l.length/2).reverse if (fhalf==shalf) true else false } def minCut(s:String,partition:Int):Int = { val ss = s.take(partition) val ts = s.takeRight(s.length - partition) if (isPelindrome(ss)&&isPelindrome(ts)) 1 else 0 } def main(args: Array[String]): Unit = { val stime = System.currentTimeMillis() val t = {for (i <- 1 to 14000) yield "a"}.foldLeft(""){case (c,s)=> s+c} val r = for (i <- 1 to t.size) yield minCut(t,i) println(r.sum) println(System.currentTimeMillis() - stime) }