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 of the following decimals has the least value 0.3 0.029 0.003 0.01
Why did some leaders believe that unicameral legislatures created more democratic governments?
what does your body do with the energy released during cellular respiration
what is the significance of the date 1787
List the multiples of 8 (up to 100)
Many progressives who followed Walter Rauschenbusch's social gospel program believed that? A)government should not regulate business. B)Christianity should be t
Which organ system of a plant functions as an anchor and as an absorption and storage unit? a. flower b. root c. leaf d. stem
Luke can read 4 pages in 1 minute. Write the ordered pair for Luke reading 0,1,2 and 3 minutes
Of these four words, which one is most likely to have a negative flavor? A. Distract B. Harangue C. Meander D. Confound
Which was the earliest experiment in self-government in England’s American colonies?