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

Question 7 (Essay Worth 6 points) In English, write about two regional dishes from Colombia. Be sure to include the name of the dish, the origins (if known), an
Which of the following statements about connecting paragraphs is correct?
a car travels 360 miles in 6 hours. How far will it travel in 15 hours
This type of material will Not allow the flow of electric current. This material is called a(n) circuit insulator conductor resistor
Is 2.5(3+x ) equivalent to 2.5x + 7.5
The nurse observes that a child fails to make eye contact and has poor impulse control. Upon further assessment, the nurse finds that the parent is an alcoholic
What is the equation of the line below?
Experts believe the neolithic agricultural revolution began:
What is the estamate of 1374 times 6
what did alex haley learn on his second trip to gambia