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

List 1 inherited trait that is ONLY based on genetics and is NOT affected by the environment in any way.
Location B is which place? Canaan Egypt Syrian Desert Mediterranean Sea
1+0.9+0.08+0.001 Somebody can help me please
desparte in silabe cuvintele date apoi incercuieste diftongii marcand semivocalele cu semnuls pecific
uld Carbon Dioxide be at its lowest level? A) July B) April C) January D) Ma What created the weather anomaly in the winter of 1980?
I don't get what they mean by writing an opinion Can I get some help?
Rahi is pouring concrete to create the foundation of a square deck covering 112 square feet. Which is the best estimate of one side of the deck? Round to the ne
Location B is which place? Canaan Egypt Syrian Desert Mediterranean Sea
A bag contains the following marbles: 8 black marbles, 12 blue marbles, 18 brown marbles, and 6 green marbles. What is the ratio of brown marbles to blue marble
To apply for a job at the new store in the mole. is this a fragmentation sentence ​