Eassiest and best complexity nlogn wher n is size of sum of both array


#1

void Solution::merge(vector &A, vector &B) {

for(int x : B)
    A.push_back(x);
  
  int n = A.size();  
int gap = (n/2);

while(gap > 0){
    int i = 0 , j = gap;
    while(j < n)
    {
        if(A[i] > A[j])
        {
            swap(A[i],A[j]);

        }
        i++;
        j++;
    }
  gap = gap/2;
}

}