Given the following, what is the pseudocode for the merge function?

Given the following, what is the pseudocode for the merge function?


A = 1st sorted array.
B = 2nd sorted array.
C = Sorted output.
i = 1, position of 1st sorted array.
j = 1, position of 2nd sorted array.

for k = 1 to n
-if A[i] < B[j]
--C[k] = A[i]
--i++
-else (B[j] is < A[i])
--C[k] = B[j]
--j++
end


Popular posts from this blog

After analyzing the model, your manager has informed that your regression model is suffering from multicollinearity. How would you check if he's true? Without losing any information, can you still build a better model?

Is rotation necessary in PCA? If yes, Why? What will happen if you don't rotate the components?

What does Latency mean?