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

Simplify 2(x-3)÷4=5-8+5
A strong sense of love and devotion toward a nation is known as what?
Which data collected during the nursing assessment for a 24-month-old client indicates the need for further evaluation for delayed language?
Bettina spoke into a microphone during the school play to increase the sound of her voice so the audience could hear her speak. The loudness of Bettina’s voice
Which is not one of the three R's? renew reduce recycle reuse
How does the Working for Water program help conserve water
If you hold a balloon by a string and the balloon moves toward your sweater and sticks there, what would you infer
What goods does Costa Rica export?
Which are National US holidays? Check all that apply. A.) New Year’s Day B.) Valentine’s Day C.) Veterans Day D.) Arbor Day E.) Mothers Day Correct answer is:
In 2/3 of a hour, workers had installed 2/5 of a foor. At the rate,what fraction of the flooring is finished after 1 hour?