2010年7月4日
摘要: public class Main { public static void main(String[] args) { int [] arr = {9,8,7,6,5,4,3,2,1,0}; insertSort(arr); for(int i:arr) System.out.println(i); } private static void insertSort(int [] arr){ fo... 阅读全文
posted @ 2010-07-04 23:23 sunliho 阅读(168) 评论(0) 推荐(0) 编辑
摘要: public class Main { public static void main(String[] args) { int [] arr = {9,8,7,6,5,4,3,2,1,0}; selectSort(arr); for(int i:arr) System.out.println(i); } private static void selectSort(int []arr){ for... 阅读全文
posted @ 2010-07-04 22:46 sunliho 阅读(196) 评论(0) 推荐(0) 编辑
摘要: public class Main { public static void main(String[] args) { int [] arr = {9,8,7,6,5,4,3,2,1,0}; bubbleSort(arr); for(int i:arr) System.out.println(i); } private static void bubbleSort(int [] arr){ fo... 阅读全文
posted @ 2010-07-04 22:34 sunliho 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public class Main { public static void main(String[] args) { int[] a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11}; int x = search(a, 12); System.out.println(x); } private static int search(int[] src, int val)... 阅读全文
posted @ 2010-07-04 09:37 sunliho 阅读(89) 评论(0) 推荐(0) 编辑
摘要: public class Main { public static void main(String[] args) { char s[] = "ababca12341234fgdf".toCharArray(); char t[] = "3412".toCharArray(); int x = search(s, t); System.out.println(x); } private stat... 阅读全文
posted @ 2010-07-04 04:44 sunliho 阅读(144) 评论(0) 推荐(0) 编辑