(1) (30%) Write a short C program that outputs all possible strings formed by using the characters 'c', 'a', 'r', 'b', 'o', and 'n' exactly once.
(2) (30%) Ackermann's function A(m, n), is a two argument function defined as follows:
A(0, n) = n + 1 |
for n >= 0 |
A(m, 0) = A(m-1, 1) |
for m > 0 |
A(m, n) = A(m-1, A(m, n-1)) |
for m, n > 0 |
Write a recursive function that gives the value of Ackermann's function.
Test your program to find out that for what range of integer parameters, (m, n), does the output of your implementation not exceed the value of the maximum integer in your C system?
(3) (40%) Let x be a
positive real. To calculate the square root of x by