You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
I think we need a base case in the code. I mean something like this:
`
procedure Merge(A,B)
if len(A) == len(B) == 1 then
return <min(A[0], B[0]), max(A[0], B[0])>
else then
(A_o, A_e) = ....
`
If we do not have this base case at the beginning, we would have an infinite recursion, wouldn't we? If A and B are composed of just one element, A_o = A and A_e = <> (Indexes start at 1). The same with B. So, Merge (A_o, B_o) would be the same as the original call Merge(A, B)
Am I right or am I missing something?
Thank you
The text was updated successfully, but these errors were encountered:
Hello,
I think we need a base case in the code. I mean something like this:
`
procedure Merge(A,B)
`
If we do not have this base case at the beginning, we would have an infinite recursion, wouldn't we? If A and B are composed of just one element, A_o = A and A_e = <> (Indexes start at 1). The same with B. So, Merge (A_o, B_o) would be the same as the original call Merge(A, B)
Am I right or am I missing something?
Thank you
The text was updated successfully, but these errors were encountered: