public class Solution { public void merge(int A[], int m, int B[], int n) { int a=m-1; int b=n-1; int index=m+n-1; while(a>=0&&b>=0) { if(A[a]>=B[b]) { A[index--]=A[a--]; } else A[index--]=B[b--]; } while(b>=0) { A[index--]=B[b--]; } } }
leetcode merge-sorted-array/,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/hansongjiang/p/3853073.html