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

Was land signed over to the British in the Treaty?
4. What changes will the colonists make after the break-up?
This was a major issue for Americans fighting the war for independence. trade agriculture money transportation
The low-road pathway from the thalamus to the amygdala most directly contributes to ________ emotional responses.
-9+z=26 pls show work ‼️ ty
please help will mark brainlest!
Fill in the Table Below for the Corresponding x - valuesxy-2024
Which of the following statements is TRUE about heart rate and exercise? A. It is best to exercise your heart as hard as possible. B. Maximum heart rate can be
Suppose the Moon were smaller in size but greater in mass than it is now. How would that affect solar eclipses and tides?
Mary Alice has been asked to help develop an outline of procedures to be followed in the event of a major IT incident or an incident that directly impacts IT. W