複製程式碼如下:import java.util.ArrayList;import java.util.Collections;import java.util.List;/*** Created with IntelliJ IDEA.* User: dell* Date: 13-3-5* Time:下午8:38* To change this template use File | Settings | File Templates.*/public class Group {public stat
首先考慮下如何將二個有序數列合併。這個很簡單,只要從比較二個數列的第一個數,誰小就先取誰,取了後就在對應數列中刪除這個數。然後再進行比較,如果有數列為空,那就直接將另一個數列的資料依序取出即可。複製程式碼程式碼如下:View Code //將有序數組a[]和b[]合併到c[]中void MemeryArray(int a[], int n, int b[], int m, int c[]) {int i, j, k;i = j = k = 0;while (i < n && j &l
複製程式碼程式碼如下:public class Wrapper {public static void main(String[] args) {int i = 500;Integer t = new Integer(i);int j = t.intValue();String s = t.toString( );System.out.println(t);整數t1 = new Integer(500);System.out.println(t.equals(t1));整數a1 = 5;