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

Who did brock lesnar beat for the wwe championship?
When calculating the Annual Percentage Rate, it is important to consider?
COMPLETE ANSWER THE ANSWER TO THE QUESTION IS I WILL VOTE BRAINLIEST B. In the given ligure, radius OB I AC at G 1. If AG = 24 cm, what is AC? 2. If AC = 38 cm
a 1 Jazmine had a bag of 24 jellybeans. If of the 5 jellybeans are white, how many jelly beans are white?
What event signaled the end of the "Dark Ages” in Europe?
What is the sociology of science? a. The scientific revolution. C. The sociological investigation of how scientific knowledge develops. B. The sociological inve
If f(x) = x2, then f(4) = 42 = 16. Find: a. f(1) b. f(-3) c. f(t)
find the volume of hydrogen (at STP) necessary to saturate 7.8 grams of benzene? ( C:12, H:1) n=m/M, V=n*STP, STP:22.4L/mol​
In addition to soil and air, what else can land pollution affect? drop-off centers recycling household garbage groundwater
Need help for English questions in photo 20 pts thank you for your help