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
Which wildcard character replaces a single character in the command-line interface?
pantera1 [17]

Answer:

? (the question mark)

Explanation:

The asterisk (*) matches one or more occurrences of any character, but the question mark matches exactly one.

6 0
3 years ago
When you begin creating a new powerpoint presentation, you need to select a ____.?
valina [46]
You would need to select a theme
5 0
3 years ago
I am a you tuber that does videos on the rob lox myth community, I have over 250+ subscribers. I was wondering if any of y'all w
Marina86 [1]

Answer:

I will for sure subscribe!!!!

Explanation:

:)

7 0
3 years ago
The type of line shown below represents an / a:​
VikaD [51]

Answer:

esrfsrtg

Explanation:

6 0
3 years ago
What is a single device that provides functionality of a printer, scanner, copy machine, and perhaps a fax machine called?
saw5 [17]
A device that provides all of the functionality listed in your question, would be a MFP (Multi-Fuction Printer)
4 0
3 years ago
Other questions:
  • _____ are skilled computer users who try to gain unauthorized access to other people’s computers.
    15·1 answer
  • A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never
    7·1 answer
  • PLEASE PLEASE PLEASE PLEASE PLEASE HELP! I'M BEGGING Y'ALL! I NEED THIS FOR TODAY! CORRECT ANSWERS WILL BE AWARDED BRAINLIEST!
    6·1 answer
  • In the transactional process model of communication, the meaning of a message resides with the ___________.
    6·1 answer
  • Alan wants to buy camera support equipment that would provide mechanical support to his camera and which could also store extra
    5·1 answer
  • 4. When you see ##### in a cell, you should
    14·2 answers
  • Which is the best reason for why it is important to be careful about entering personal information online?
    10·2 answers
  • Identify the parts of it, Give at least three web browser that you usually used to visit a website.​
    10·1 answer
  • a) consider the binary number 11010010. what is the base-4 representation of (11010010)2? (there is a way to do this without con
    13·1 answer
  • missy just hired a software development team to create an educational simulation app for a high school course. she has specific
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!