clarajeansonels8190 clarajeansonels8190
  • 14-09-2019
  • Mathematics
contestada

3. Write a recursive algorithm of the sequence t(1)=1 and t(n)=n2 t(n-1) as a function.

Respuesta :

joaobezerra joaobezerra
  • 23-09-2019

Answer:

int t(int n){

     if(n == 1)

          return 1;

     else

          return n*n*t(n-1);

}

Step-by-step explanation:

A recursive function is a function that calls itself.

I am going to give you an example of this algorithm in the C language of programming.

int t(int n){

     if(n == 1)

          return 1;

     else

          return n*n*t(n-1);

}

The function is named t. In the else clause, the function calls itself, so it is recursive.

Answer Link

Otras preguntas

What is the weight of a man whose mass is 80 kg?
In To Kill A Mockingbird, when Atticus was standing in front of jail protecting Tom Robinson, and all those men showed up, why did they leave after Scout kept t
The type of bond between atoms in a molecule of CO2 (electronegativity difference = ~1) a. hydrogen bond b. ionic bond c. polar covalent bond d. pure covalen
1 4 2 8 3 12 4 16 5 20 And the function graph above what is the input what is the output
A fertile hypha that bears spores is called a?
1. What is the shortest distance from a point to a line?A) a perpendicular segmentB) a transversalC) a parallel segmentD) an arc
Why does copper have a high melting point?
1 4 2 8 3 12 4 16 5 20 And the function graph above what is the input what is the output
Factor completely 4u^2 + 28u + 49
What is 0.42,3.47 and 3.74 in order from least to greatest