摘要: public class BinarySearch{ public static void main(String[] args) { int arr[]={2,3,4,5,7,8,9,10}; BinarySearch bs=new BinarySearch(); bs.search(arr,8,0,arr.length-1); bs.search(arr,6,0,arr.length-1); } public void search(int arr[],int value,int left,int right) { if (left>right) { System.ou... 阅读全文
posted @ 2013-09-21 13:19 hello,MR.Guo 阅读(177) 评论(0) 推荐(0) 编辑
摘要: http://java.chinaitlab.com/base/810244.htmlhttp://www.cnblogs.com/rollenholt/archive/2011/07/04/2097081.htmlhttp://www.w3school.com.cn/js/index_pro.asphttp://java.chinaitlab.com/base/810244.html序号 运算符 含义 1 + 加法 2 - 减法 3 * 乘法 4 / 除法 5 % 模运算(取余运算) 6 ++ 递增运算 7 -- 递减运算 Java的算术运算符分为一元运算符和二元运算符。一元... 阅读全文
posted @ 2013-09-21 13:09 hello,MR.Guo 阅读(295) 评论(0) 推荐(0) 编辑
摘要: http://blog.sina.com.cn/s/blog_7c5064110100psax.htmlJava中提供了两个类型的算术运算符,一是双目运算符,一是单目运算符。其中双目运算符包括:(加)+,(减)-,(乘)*,(除)/,(求余)%使用它们时应注意以下几点:1)这些运算符的运算对象可以是byte、short、int、long、float、double、char类型,其中char类型在运算时被自动转为int型。例:public class Test1{public static void main(String arg[]){int A = 10;char B = 'B 阅读全文
posted @ 2013-09-21 13:04 hello,MR.Guo 阅读(1613) 评论(0) 推荐(0) 编辑
摘要: public class MaoPao{ public static void main(String []args) { int arr[]={14,52,16,37,8}; boolean flag=false; for (int i=0;i<arr.length-1;i++) { for (int j=0;j<arr.length-i-1;j++) { if (arr[j]<arr[j+1]) { int temp; temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; flag=t... 阅读全文
posted @ 2013-09-21 12:09 hello,MR.Guo 阅读(115) 评论(0) 推荐(0) 编辑