2015年3月19日
摘要: 1 class Node { 2 int val; 3 Node next; 4 5 Node(int x) { 6 val = x; 7 next = null; 8 } 9 }10 11 class Stack {12 ... 阅读全文
posted @ 2015-03-19 21:11 zhangbz 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 1 public class QuickSortTest{ 2 //比较与交换 3 private static int partition(int[] source, int low, int hight) { 4 int key = source[low]; 5... 阅读全文
posted @ 2015-03-19 17:28 zhangbz 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1 public class InsertSortTest{ 2 public static void InsertSort(int[] source) { 3 //默认第一个元素已排序 4 for (int i = 1; i 0) && (source[... 阅读全文
posted @ 2015-03-19 15:42 zhangbz 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 public class SelectSortTest { 2 public static void selectSort(int[] source) { 3 for (int i = 0; i source[j]) { 6 s... 阅读全文
posted @ 2015-03-19 14:37 zhangbz 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 public class BubbleSortTest { 2 //冒泡排序 3 public static void bubbleSort(int[] source) { 4 //外层循环控制控制遍历次数,n个数排序,遍历n - 1次 5 fo... 阅读全文
posted @ 2015-03-19 13:59 zhangbz 阅读(196) 评论(0) 推荐(0) 编辑