每周完成一个ARTS(Algorithm,Review,Tips,Share):至少做一道leetcode算法题,阅读并点评至少一篇英文技术文章,学习至少一个技术技巧,分享一篇有观点和思考的技术文章.
Algorithm
Implementintsqrt(intx).Computeandreturnthesquarerootofx,wherexisguaranteedtobeanon-negativeinteger.Sincethereturntypeisaninteger,thedecimaldigitsaretruncatedandonlytheintegerpartoftheresultisreturned.Example1:Input:4Output:2Example2:Input:8Output:2Explanation:Thesquarerootof8is2....,andsincethedecimalpartistruncated,2isreturned.classSolution{publicintmySqrt(intx){ints=(int)Math.sqrt(x);returns;}}
Review:Java内存模型的介绍
转载请注明:http://www.quwenlai.com/zejq/17671.html