http://oj.leetcode.com/problems/merge-sorted-array/
class Solution {
public:
void merge(int A[], int m, int B[], int n) {
int indexA=m-1;
int indexB=n-1;
int current=m+n-1;
while(indexA>=0&&indexB>=0){
if(A[indexA]>B[indexB])
A[current--]=A[indexA--];
else
A[current--]=B[indexB--];
}
for(int i=0;i<=indexB;i++) A[i]=B[i];
}
};