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 an assembly qualified name? Is it a filename? How is it different?
What is the purpose of escape sequence?
is it possible to access a remote web service Without UDDI?
Define Virtual folder?
Can I use exceptions in c#?
What is parsing?
In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?
What is an inheritance ?Give an example in which inheritance is used?
What is dto c#?
Does console.writeline() stop printing when it reaches a null character within a string?
What is difference between ienumerable and ienumerator in c#?
What is difference between array and collection in c#?
write a C# Program add two matrix ?
How do I create a single-file assembly?
What is disconnected data architecture in c#?