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

Which philosopher questioned the "divine right" of monarchs?
The area of a square is 9ft find the area of a square with 4 times as large
Which court case is this from? miranda v. arizona tinker v. des moines school district engel v. vitale
Suppose that 18 inches of wire costs 72 cents. At the same rate, how many inches of wire can be bought for 44 cents
An aircraft​ (at Z) is spotted by two observers​ (at X and​ Y) who are L=1750 feet apart . As the airplane passes over the line joining​ them, each observer tak
What 3 groups of people mostly lived in the tidewater and piedmont areas
How to send large video files without losing quality
Given P(E or F) = 0.69, P(E) = 0.49, and P(E and F) = 0.06, what is P(F)?
which trig ratio determine which trig ratio to use to solve for x
what does fame mean ? ty #)​