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 function is defined by f(x)=5(2-x) what us f(-1)​
Which type of figurative language is used in the sentence
PLS HELP A running track in the shape of an oval is shown. The ends of the track form semicircles. What is the perimeter of the inside of the track? (π = 3.14)
What are the two reactants needed for respiration to occur?​
Please help with 1 and 2 I’ll give brainliest
I need help with this question and I’ll give brainliest! Thanks! What does one today equals two tomorrows mean? Do you agree with it? Why or why not?
The cochlea is like a rolled up triangle which allows us to hear what part of sound? Answer: Acoustics Decibels Osculation Timbre Pitch Amplitude
Why is setting important to a story
Which type of doctor specializes in treating cancer patients?
What was the commercial revolution