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

We have no quarrel with the German people. We have no feeling towards them but one of sympathy and friendship. It was not upon their impulse that their Governme
Michael took 12 tests in his math class
is a pair of scissorrs a lever and wedge?
-x+3y=6 x+3y =18 elimination
Using the following vocabulary describe in spanish what you do in your spare time.
Need help asap please and thank you!
hello its my birthday please help me !!
A truck quickly moving down a hill is said to have Question 1 options: Large amounts of elastic energy Large amounts of physical energy Large amounts of potenti
a __________ defines the area of land that will supply water to a stream.
Desribe how plant cells look and what shape they are in.