Guest User

Untitled

a guest
Apr 22nd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. void mischen(int m,double a[], int n, double b[], double c[]){ //a[m] b[n],c[]
  2.     int cIndex = m+n+1; // Index des Array C //Plus eins da die größe des neuen Arrays =
  3.    
  4.     if(n<0)
  5.     {
  6.         copy(m,0,a,c); // Wenn B leer ist rest von a in c kopieren
  7.     }
  8.     else if(m<0)
  9.     {
  10.         copy(n,0,b,c); // Wenn A leer ist rest von b in c kopieren
  11.     }
  12.     else if(a[m]>= b[n])
  13.     {
  14.         c[cIndex] = a[m];
  15.         //cout<<c[cIndex]<<" n="<<n<<" m="<<m<<" Index="<<cIndex<<endl;
  16.         m--;
  17.         mischen(m,a,n,b,c);
  18.     }
  19.     else if(a[m]<= b[n])
  20.     {
  21.         c[cIndex] = b[n];
  22.        //cout<<c[cIndex]<<" n="<<n<<" m="<<m<<" Index="<<cIndex<<endl;
  23.         n--;
  24.         mischen(m,a,n,b,c);    
  25.     }
  26. }
Add Comment
Please, Sign In to add comment