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

X+3y=5 -2x-6y=-10 Solve using elimination
suppose ken has 25 coins in nickels and dimes only with a total of $1.65. How many of each coin does he have?
What is the second part of Zhou dynasty
15% of 60 and what is a model for it
Janice correctly answered 21 of the 24 questions. what percent of the questions did she answer correctly?
an increase in the transparency of earths atmosphere is often caused by
The_________ led to the end of the concert of Europe
Economic changes, internal conflict and new industry are all __________________. a. changes since the end of communism c. new issues developing in Romania b. pr
A wave travels at 3 m/s along a spring toy. If the wavelength is .2 m, what is the waves frequency?
Anglo-Saxon England was conquered in 1066 by __________. Charlemagne Attila the Hun Charles Martel Duke William of Normandy