+ 3
Merge two arrays by following given sequences.
Given two arrays of integers x and y of sizes m and n respectively. Write a program with a function named merge() which will produce a third array named z, such that the following sequences is followed: 1. All odd no of x from left to right are copied into z from left to right. 2. All even no of x from left to right are copied into z from right to left. 3. All odd no of y from left to right are copied into z from left to right. 4. All even no of y from left to right are copied into z from right to left.
9 Respuestas
+ 3
My answer ...
https://code.sololearn.com/cOY8MO4Rr2st/?ref=app
+ 2
https://code.sololearn.com/chUIGkd9OgLx/?ref=app
+ 2
Here's the cpp program as you want and takes input of two arrays x and y from the user.
https://code.sololearn.com/cDp4HR6pLan4/?ref=app
Firstly you have to enter no. of terms in x and y and then their values respectively.
+ 1
e.g., x is { 3, 2, 1, 7, 6, 3 }
and y is { 9, 3, 5, 6, 2, 8, 10 }
then z = { 3, 1, 7, 3, 9, 3, 5, 10, 8, 2, 6, 6, 2 }
+ 1
hey, challenge accepted, here on JavaScript: https://code.sololearn.com/WZKmo7mHodUK/?ref=app
noticed by comment on:
https://code.sololearn.com/WoUjEYWDOir8/?ref=app
0
Here ya go!
https://code.sololearn.com/c5MVWqUJeXH3/?ref=app