c# code for how to merge two sorted arrays
Input : A = 2,5,8,4
B = 3,9,10,5
Output : 2,3,4,5,5,8,9,10
Answer Posted / m.shanmuga sundaram, rjnsoftwa
int[] A = {2,5,8,4};
int[] B = { 3, 9, 10, 5 };
int[] C = new int[A.Length + B.Length];
A.CopyTo(C, 0);
B.CopyTo(C, A.Length);
Array.Sort(C);
foreach (int num in C)
{
Console.WriteLine(num);
}
| Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
What is the components of window?
What are the collections in c#?
What is class method c#?
What is view state c#?
Why would you use untrusted verification?
Can we customize the serialization process?
How C# 4.0 supports dynamic programming language?
What is difference between internal and protected internal in c#?
Explain how do I convert a string to an int in c#?
How long does it take to get a loop recorder put in?
Can a method be sealed in c#?
How many dimensions can an array have?
Is versioning applicable to private assemblies?
Can we make a class private in c#?
Is c# easier than javascript?