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

Jim has gotten scores of 99 and 93 on his first two tests. what score must he get on his third test to keep an average of 90 or greater
What's the term for: unwilling to bend; unyielding
write a system of equations and solvea class of 195 students went on a field trip. They took 7 vehicles,some cars and some buses. find the number of cars and nu
what is glossities and deficiency
which designer started as a fashion illustrator before focusing on industrial design?
What's the word for to talk on and on pointlessly, without clear direction
write a system of equations and solvea class of 195 students went on a field trip. They took 7 vehicles,some cars and some buses. find the number of cars and nu
What's the other word a weak or lifeless feeling
I figured out the 1st question but I do not understand the second one...please show me step by step! Thank you!
I figured out the 1st question but I do not understand the second one...please show me step by step! Thank you!