-1
What would be the complexity function and the Big O of the code below?
int[] alg4(int[] arr1, int[] arr2) {
int i = 0;
int j = 0;
int[] arr3 = new int[arr1.Length+arr2.Length];
for (i = 0; i < arr1.Length; i++)
arr3[j++] = arr1[i];
for (i = 0; i < arr2.Length; i++)
arr3[j++] = arr2[i];
return arr3;
}
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero