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

estimate . then find the difference 4.23-2.51
Important things about the history of silk production and the lessons
According to what you just learned about cause and effect, the “cause” was poor economic policies, and the “effect” was
luis wanted to buy a skateboard that usually sells for $79.99. All merchandise is discounted by 12%. What is the total cost of the skateboard if Luis has to pay
Arwan finds a piece of quartz while hiking in the mountains. When he returns to school, he takes it to his science teacher. She helps him determine the mass to
what kind of bird symbolizes love
How was Henry Ford able to charge significantly less for the same automobile 10 years later?
Use guess and check to find two numbers that have the sum of 8 and a difference of 6.
what layer of the earth is broken into pieces called tectonic plates
Hector serves ice cream at a local ice creme shop he sells 19 ice cream cones on Saturday 27 on Sunday and 153 the entire week how many ice creme cones did he s