3 votes 3 votes Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n-1,p), p-1); } Express $A(m, n, 1)$ as a function of $m$ and $n$. Algorithms cmi2014 descriptive algorithms identify-function + – go_editor asked May 27, 2016 go_editor 646 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes A(m, n, 1) = A(m, A(m, n -1, 1) ,0) To compute this we solve the base cases first: The base case is : A(m, 0, 1) = 0 = m∗0 So the value of : A(m,n -1,1) = m(n-1) So A(m,n,1)=A(m, m(n-1) ,0) =m+m(n-1) A(m,n,1) =mn ManojK answered May 27, 2016 ManojK comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer: soujanyareddy13 answered May 7, 2021 soujanyareddy13 comment Share Follow See all 0 reply Please log in or register to add a comment.