面试题 10.01
Solutions
class Solution {
public:
void merge(vector<int>& A, int m, vector<int>& B, int n) {
int w = A.size();
while (n > 0) {
if (m > 0 && A[m - 1] > B[n - 1])
A[--w] = A[--m];
else
A[--w] = B[--n];
}
}
};Last updated