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 is aluminium more reactive than chromium, in terms of electrons?
NEED HELP ASAP PLEASE
Discuss how career choices impact the balance between personal and professional responsibilities. In your response, consider components of your career plan such
If a musician increases the wavelength of the sound wave she is produces without changing their speed, what must be happening to the frequency?
**PLEASE HELP QUICKLY 100 POINTS** Which function has a range of y < 3? y = 3 (2) Superscript x y = 3 (3) Superscript x y = negative (2) Superscript x Baseli
Can someone help me with these questions
what is Consulted? A.) nounB.) verbC.) adjectiveD.) other​
At your next meeting with the senior management team, you suggest this, and you're met with a lot of blank looks. The managers don't seem to quite understand wh
Please help answer the questions!
If 75% of the budget is 1200, what is the full budget? Using a tape diagram.I need like an actual picture