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

why do people have to vote for our presidents
45 - point question! Help me on the attached file and explain answer please! :D
How is a lithium atom (Li) different from a lithium ion (Li+)
what is 0.05×0.8 please help
How is a fable part of an oral tradition?
Fats are the main substances that are essential for body growth and repair. Answer a. True b. False
How did the government regulate banks and the stock market in the first Roosevelt administration
Sodium burns in chlorine to form sodium chloride, NaCl. How many grams of sodium chloride will be formed when 1.8 g of sodium is burned in 2.00 g of chlorine? W
Select all that apply. Scientific words often come from ____. German words Latin words Spanish words Greek words
What is 1/100 as a percent?