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

I cleaned 6/9 of my room, and my friend cleaned 2/9 of my room. How much of my room do we still have to clean?
how does consumerism help shape supply and demand in the US economy?u
Please help me please:)
Why were people sent to internment camps during WWII?
lanthanides definition​
why did henry viii seperate from catholism
Substituting y=-2 in the equation Solve the problem -2x+_____=-12
round 249,982 to the nearest hundred​
Is it a square, rhombus, or a rectangle? Why?
I need help on this please. people are giving me the wrong answer, please give me a right answer