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

the Key idea of John Locke's enlightenment theory was to protect and enhance the freedoms and rights of
*HELP PLEASE WILL THANK AND AWARD BRAINLIEST ANSWER*Given figure ABCD ~ figure KLMN, what is the value of y?   A.1.2 cm  B.3.6 cm  C.4 cm D.12 cm
• When creating value for a customer, why is product differentiation so important? •
Is/are the most concentrated form of energy. Fast proteins carbohydrates
Using the following words, write sentences that describe settlers traveling on the Oregon Trail.a. Manifest Destiny b. emigrant c. prairie schooner
The return on investment (ROI) from education is typically the highest for:
Which book was responsible for promoting the investigation illustrated in this cartoon
Is a Tokyo or Japan a city?
The BEST type of test for assessing skill-related fitness depends on
___ are files of related records organized according to logical systems and stored on computer-accessible media.