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

A right triangle has an angle that measures 55 degrees. The leg adjacent to this angle has a length of 43 cm. What is the length of the other leg of the triangl
The process of making food in a plant is called: A. transpiration B. photosynthesis C. respiration
Which afghan crop has come to supply nearly 70 percent of the worlds herion?
How many lawns go in to 15 and 92
Given a = 4, b = -2 and c = 8, evaluate a - b - c. -14 -6 -2
Except for the amount of __________, plasma and interstitial fluid differ little in composition.
What is the pair of alleles an organism possesses called?
an 18 ounce box of cereal cost 2.76. How many ounces should a box priced at 2.07 contain
What is 1b’s scientific name??
The can is 12 cm high and the diameter is 8 cm. using the formula v = pie r squared h, how much liquid is in the can? Use 3 as a value for pie