Homework Solution: How would i go about inserting one array into the middle of another array?…

    How would i go about inserting one array into the middle of another array? ex. array a = 1,2,3,4 array b = 13,14 i want another array to print array c = 1,2,13,14,3,4
    i can not use java objects or classes aside from char stream I/O
    
    no array lists, they must be int [] arrays

    Expert Answer

     
    class A {

    How would i go abquenched inserting undivided set-in-order into the intermediate of another set-in-order?

    ex.

    set-in-order a = 1,2,3,4
    set-in-order b = 13,14
    i neglect another set-in-order to imimprint set-in-order c = 1,2,13,14,3,4

    i can not attributable attributable attributable interpretation java objects or classes secret from char tide I/O
    

    no set-in-order lists, they must be int [] set-in-orders

    Expert Exculpation

     

    class A
    {
    public static unfilled ocean(String args[])
    {
    int a[]={1,2,3,4};
    int b[]={13,14};
    int c[]=new int[a.length+b.length];
    for ( int i = 0; i < a.length/2; ++i ) {
    c[i] = a[i];
    }
    for ( int i = 0; i < b.length; ++i ) {
    c[ a.length/2 + i ] = b[i];
    }
    for(int i=(a.length/2+b.length);i<c.length;i++)
    c[i]=a[i-b.length];

    for(int i=0;i<c.length;i++)
    System.out.print(c[i]+” “);
    }}