1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
8090 [49]
3 years ago
11

Write a function merge that merges two lists into one, alternating elements from each list until the end of one of the lists has

been reached, then appending the remaining elements of the other list.
Computers and Technology
1 answer:
Anna007 [38]3 years ago
5 0

Explanation:

The program that merges two lists or two arrays is written below;

Code :

void main void

{

char [] arr1= {'1','2','3'};

char [] arr2= {'a','b','c','d','e'};

int l1= arr1.length;

int l2=arr2.length;

int l3=l1+l2;

char [] arr3=new char[l1+l2];

int i=0;

int j=0;

int k=0;

int m=0;

int r=0;

if(l1<l2)

   r=l1;

else

   r=l2;

while(m<r)

{

   arr3[k++]=arr1[i++];

   arr3[k++]=arr2[j++];

   m++;

}

while(k<l3)

{

   if(l1<l2)

       arr3[k++]=arr2[j++];

   else

       arr3[k++]=arr1[i++];

}

for(int n=0;n<l3;n++)

{

   System.out.print(arr3[n]+" ");

}

}

You might be interested in
Assume that success is a variable of type boolean that has been declared. Assume that processor refers to an object that provide
Iteru [2.4K]
Try {
AutoFactory.shutdown();
} catch (ProductionInProgressException e) {
AutoFactory.reset();
}
6 0
3 years ago
Differences of a desktop computer and a laptop
Ilya [14]

Answer:

Desktop can't move easily, not portable. Laptop very portable.

Explanation:

6 0
2 years ago
TQ Sustainability &amp; Technology
harkovskaia [24]

A way to make the metro system more sustainable is to use machine learning so as to optimize the frequency of train routes  using passenger load.

<h3>What is a sustainable transport system?</h3>

This sustainable transport system is known to be a kind of system that aids the basic access and growth needs of the society to be met rightly and safely.

This also should be meant in a way that is consistent with human and ecosystem health, and boast equity in all successive generations.

Other methods are the use of Cooling System to lower temperature and non waste of Energy and also lower the Noise Levels.

learn more about Sustainability from

brainly.com/question/25032305

4 0
2 years ago
In preparing categorical variables for analysis, it is usually best to a. combine as many categories as possible. b. convert the
Genrish500 [490]

Answer:

In the given question the correct option is missing, which can be described as follows:

"It transforms binary, null variables into the groups."

Explanation:

These variables are real variables, which could also take up a series of variables, that are either constrained or defined. This can be regarded as a listing. It is used to analyze and convert it, into binary in the following ways, and wrong choices can be described as follows:

  • In option a, It can't combine, it only converts.
  • Option b and Option c is wrong because, it can't convert numeric, it only convert binary number to dummy variables.

5 0
3 years ago
Powerpoint increased the weight of a line in ____ increments.
USPshnik [31]
<span>One-fourth increments</span>
4 0
3 years ago
Other questions:
  • Americans overwhelmingly support organ and tissue donation.
    5·1 answer
  • Data_____is defined as the condition in which all of the data in the database are consistent with the real-world events and cond
    9·1 answer
  • 27. List four advantages of Computer Aided Design over traditional hand
    10·1 answer
  • Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li
    11·1 answer
  • Which of the following is not a type of Internet Job Board? Options Resume Blaster Professional Association Target Applicants We
    8·1 answer
  • Which of the following is true of the poka-yoke approach used for mistake-proofing processes?
    9·2 answers
  • What are the factors that affect self-confidence?
    15·1 answer
  • Categorize each of the following situations as a compile-time error, run-time error, or logical error. Group of answer choices m
    5·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    9·1 answer
  • Which artificial intelligence term is used to describe extracting information from unstructured text.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!