Write programs for the Ackerman function shown below in C and in Scheme (Racket). Functionality and Documentation is critical in these programs. Be sure your code is your own. If you get outside help, you will receive a zero for this exam. When you submit the programs, upload the c code and scheme code in separate files. The Ackermann function is defined recursively for two non-negative integers’ s and t as follows. A(s, t) = {(t+1,@A(s-1,1),@A(s-1,A(s,t-1)),)┤ ■(if s=0@ if s>0 and t=0@ if s>0 and t>0) Follow the methods discussed for writing recursive methods. Implement the function A(s t) in C. The function should take two inter numbers, m and n, and return the value of A(s, t), which is a long integer. Notice that the Ackerman function is a very rapidly growing function. Even values of 4 for m and n will yield an extremely large number, and thus using a long integer as the return value is necessary. Write a main program that takes inputs of m and n from the keyboard; call the recursive function, and then print the results. Repeat the above coding exercise, but in Scheme.
The Code for given program is as follows:
#include <stdio.h>
int A(int,int );
int main()
{
int m,n;
scanf("%d%d",&m,&n);
int p= A(m,n);
printf("%d",p);
return 0;
}
int A(s,t)
{int t1;
if(s==0) { return (t+1);}
if(s>0 && t==0) { return A(s-1,t); }
if(s>0 && t>0) {t1 = A(s,t-1) ; return A(s-1, t1);
}
}


Write programs for the Ackerman function shown below in C and in Scheme (Racket). Functionality and...
PLEASE USE VERY BASIC REGISTERS AND CODE TO DO THE FOLLOWING Objectives: -write assembly language programs to: -define a recursive procedure/function and call it. -use syscall operations to display integers and strings on the console window -use syscall operations to read integers from the keyboard. Assignment Description: Implement a MIPS assembly language program that defines "main", and "function1" procedures. The function1 is recursive and should be defined as: function1(n) = (2*n)+9 if n <= 5 =...
I am looking for toe menu "3" Ackermann table lookup function.
IN JAVA
I already made my own menu, value, trace functions I just need
table lookup function
Ackermann's function Please create the following menu for the Ackermann project. This program allows you to call the Ackermann function. Please choose a version of Ackermann's Function. 1) Ackermann value. 2) Ackermann trace 3) Ackermann table lookup. 4) Quit playing with the Ackermann Function. Please choose one of the 4 choices Ackermann's...
Scheme number computer a. Write a recursive procedure (digits n) that computes the number of digits in the integer n using a recursive process. For example, (digits 42) should return 2 and (digits 13579) should return 5. You may make use of the built in floor predicate for truncating decimals to whole numbers. b. Rewrite your procedure from part (a) using an iterative process. Call the function (digits-iter n).
in large programs, it can be helpful to have a function specificaly for printing out an error message to the user or to a log when an exception (an error) has occurred Generally speaking, errors are tracked through unique error codes, making it easy for the programmer to implement. Assume you are given the task to implement a function for manager wants you to implement a basic function for now to check the functionality Implement a function called displayError, with...
Objective To program using the functional programming paradigm Assignment: Write the following functions using Scheme (or LISP if you prefer) . A function (binomial N k) that returns the binomial coefficients C(N, k), defined recursively as: C(NO) = 1, C(N, N) = 1, and, for 0<k < N E(N, k) = C(N-1, k) + C(N-1, k-1) 2. A function (mod N M) that returns the modulus remainder when dividing N by M 3. A function (binaryToDecimal b) that takes a...
Below is is a scheme function. For your answer, write a comment for this piece of code in valid scheme syntax. (define (factorial n) (if (=n0) (* n (factorial (- n 1))))) The elements to include in your comment that is described in your own w ords (succinctly, such as if you were commenting code instead of a survey) ... 1) the necessary formatting to indicate it is a legal scheme comment 2) expected input 3) expected output 4) what...
Write a recursive scheme function EXP-DEPTH that returns the depth of the most nested parentheses in a list. (EXP-DEPTH ’A) is 0, (EXP-DEPTH ’( )) is 1, (EXP-DEPTH ’(1 2 3) ) should return 1. (EXP-DEPTH ’(I J ((K) L) M)) should return 3, since the element K is nested in three levels of parentheses. Please use scheme function
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. This problem need to use DrRacket software. Racket Language. Write a function named (first-n L1 N) that returns the first N elements of L1. If N is negative, return the empty list. If N exceeds the length of L1 return all elements of L1. (first-n...
How can I make this into a recursive function (C++)?? //Write a function that, given positive integers 1 <= n <= 10^4 and 1 <= s <= n as input, returns the sum of the last s elements in the sequence from 1 to n (inclusive). unsigned long int suffix_sum(unsigned int n, unsigned int s){ unsigned long int sum = 0,r=(n-s)+1; while (r<=n){ sum = sum + r; r++; } return sum; return 0; }
1. Recursion is ususally where a function calls itself; (another example of recursion is where function A calls function B, and B calls C and C calls A, creating a loop in the calls). Some problems are most naturally solved recursively, such as writing the factorial function, or finding all the perumutations of a sequence, or checking if a string is a palindrome. Since those examples were done in class, here we will give you a toy example, which normally...