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 from Campbell Biology Chapter 23: 4) Which statement about the beak size of finches on the island of Daphne Major during prolonged drought is true? A)
explain how you would use the commutative property of multiplication to answer 7x3
___ connect phrases or clauses.
which of these is a mixture? a. oxygen b. air c. carbon dioxide d. carbon
An unknown substance can be identified by its mass. a flame test its density B and C
1) In order to avoid peer pressure, it is important to recognize __________. A) what peer pressure is and who the victims of peer pressure are. B) who is troubl
What is one type of drug that is commonly slipped in drinks tor cause disorientation and lessen inhibitions A.)DTS B.)STD C.)GHB D.)BHG
1,495 divided by 45 please help me before tomorrow
Determine the perimeter of ABCD.
_____ is the type of literature in which a person writes about one's own life. a.burlesque b.satire c.heroic drama d.elizabethan drama e.autobiography