void M3(int N, int M){
if(N > 0)
M3(M, N – 1) ;
else if(M > 0)
M3(M – 1, N) ;
}
Noting thqt the recursive call params are reversed
I believed it’s
min(N,M)
but i just couldn’t figure it
one of my friends said that its actually ,o(N+M)
New contributor
reda tlb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.