摘要: 只有當左邊的指大於pivot,右邊的值小於pivot才交換 1 public static quickSortOptimized(int[] data,int left,int right){ 2 3 int pivotIndex=(left+right)/2; 4 int pivotValue=... 阅读全文
posted @ 2014-10-25 10:36 TonyChiang 阅读(153) 评论(0) 推荐(0)
摘要: 1 public void quickSortSwapping(int data[]){ 2 //call this method 3 quickSortSwapping(data,0,data.length); 4 } 5 6 7 public void quickSortSwapping(... 阅读全文
posted @ 2014-10-24 11:12 TonyChiang 阅读(162) 评论(0) 推荐(0)
摘要: 1/* 1.Node.java*/ 2 package Chapter2; 3 4 public class Node { //T可以是int,string等 5 public T data; 6 public Node next; 7 public Node(T d, Nod... 阅读全文
posted @ 2014-10-20 20:09 TonyChiang 阅读(158) 评论(0) 推荐(0)
摘要: 1 public class Q1_7{ 2 3 public static void SetZero(int[][] matrix){ 4 5 boolean [] row= new boolean[matrix. length]; 6 7 boolean[] column =new ... 阅读全文
posted @ 2014-10-20 20:05 TonyChiang 阅读(129) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-10-19 21:49 TonyChiang 阅读(5) 评论(0) 推荐(0)
摘要: public boolean isUniqueChars2(String str) { int checker = 0; for (int i = 0; i 0) { return false; } else ... 阅读全文
posted @ 2014-08-14 15:54 TonyChiang 阅读(206) 评论(0) 推荐(0)