摘要: 今天看到的面试题,想了一下,贴出来 1 import java.util.ArrayList; 2 import java.util.List; 3 4 public class DeleteSameCharacter { 5 6 /** 7 * 去除字符串中相同的字符,保留一次 8 * 9 * **/10 public static void main(String[] args) {11 String s = "abcabcdef";12 char[] chs = s.toCharArray();13 ... 阅读全文
posted @ 2013-06-04 21:39 Myhfm 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 最近复习课本,看到了这两个简单的算法,就贴出来,冒泡和二分法很简单,不解释 。 1 import java.util.Scanner; 2 3 public class BubblesSortAlgorithm { 4 5 @SuppressWarnings("resource") 6 public static void main(String[] args) { 7 int[] arrs = { 1, 23, 5, 2, 6, 3, 55, 9 }; 8 int i, j, temp = 0; 9 for (i = arr... 阅读全文
posted @ 2013-06-04 21:25 Myhfm 阅读(122) 评论(0) 推荐(0) 编辑