class Solution {
public:
/**
* @param A: sorted integer array A which has m elements,
* but size of A is m+n
* @param B: sorted integer array B which has n elements
* @return: void
*/
void mergeSortedArray(int A[], int m, int B[], int n) {
// write your code here
int *p=&A[0],q=m;
for(int i=0;i<n;i++){
A[q]=B[i];
++q;
}
sort(p,p+m+n);
}
};
LintCode(easy)合并排序数组II
最新推荐文章于 2022-04-28 23:08:10 发布