JoeM3388 JoeM3388
  • 03-04-2015
  • Computers and Technology
contestada

Give a recursive algorithm for finding the sum of the
first n odd positive integers.

Respuesta :

Hippalectryon
Hippalectryon Hippalectryon
  • 03-04-2015
I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

function sumOdd(n)
    if n==1 then
        return 1
    end if
    return (sumOdd(n-1))+(n*2-1)
end function
Answer Link

Otras preguntas

What is the temperature of a gas in which the atoms are moving very, very slowly? Question 9 options: cold hot room temperature
Why are heroes so important to understanding the universal psyche of humans
what amendment did progressives support because they wanted the rich to pay more taxes?
Factor completely: x2 + 10x + 24 (Which is the right answer?) Prime (x + 12)(x + 2) (x + 3)(x + 8) (x + 6)(x + 4)
Which of the following statements about the smooth endoplasmic reticulum is/are correct? Liver cells are abundant in SER. The testes and ovaries are tissue type
Which is true about these lines?
One of the essential minerals in the human body is salt. How much salt (NaCl) is in the average adult human body?
15cm= inch HEEEEEEEEEEEEEEEELP!!,
How does the Fourth Amendment benefit the citizens of the United States?A. It defends citizens against unreasonable search and seizure.B. It grants citizens the
What’s 115% as a fraction