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

By 1900 the united states had created an overseas empire. was this empire a natural culmination of its expansion at home?
What is 7% of $20.00?
__________ are the most likely segment of the population in the united states to experience poverty today.
A globe is placed on your desk and you are asked to identify its physical properties. How would you describe the globe?
What is 15% of 40% of $180
Shauna and scott feel like they know everything about one another. they are passionately attracted to each other. but when they are done with college they may p
The point slope form of the equation of the line that passes through (-4, -3) and (12, 1) is y-1- 1-12). What is the standard form of the equation for this line
Challenge problem: Is it possible to find the square root of a negative number? Why or why not?
write an equation that is perpendicular to y = 2x + 5 and passes through (3 , -2)
Marcus's family purchased a trampoline in 2000. they sold the trampoline at a garage sale in 2010 to zac's family. in 2012, zac is injured while jumping on the