2013年8月26日

将两个已排好序的数组,合并成一个新的排好序的数组

摘要: 1 /** 2 * 3 * @author hanxin 4 * 标题:将两个已排好序的数组,合并成一个新的排好序的数组 5 * 6 */ 7 public class Merge { 8 9 /**10 * @param args11 */12 public static void main(String[] args) {13 // TODO Auto-generated method stub14 ArrayList C=mergeAB(A, B);15 System.out.printl... 阅读全文

posted @ 2013-08-26 15:16 一直很安静的我 阅读(617) 评论(0) 推荐(0) 编辑

求数组元素的并集

摘要: 1 /** 2 * 3 * @author hanxin 4 * 标题:实现C=A并B 5 */ 6 7 public class Union 8 { 9 public static int[] A={3,5,20,8,11,2,6};//数组A10 public static int[] B={2,6,8,9,11,15,5,20,44};//数组B11 public static ArrayList union(int[] A,int [] B)12 {13 ArrayList C=new ArrayList();14 ... 阅读全文

posted @ 2013-08-26 08:55 一直很安静的我 阅读(210) 评论(0) 推荐(0) 编辑

导航