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

How was the battle of bunker hill an american success even though it was a british victory?
Researchers are exploring whether treatment with ________ might improve social behavior in those with asd.
Which two sets of lines in the poem illustrate that death's power is an illusion? Sonnet 10 by John Donne Death, be not proud, though some have called thee Mig
accounting i know that when there's two panels its debit and credit but what is the third for what is each one
How is parasitism different from commensalism? a. both organisms benefit in parasitism and only one organism benefits in commensalism. b. one organism benefits
Thinking about suicide is called _________, and a suicide attempt that is not completed is called __________.
The group that receives the treatment or test stimulus or factor under study is called the
The degree measure of angle a is 135°. which expression below is equivalent to the radian measure of angle a?
how is an error within an EMR corrected
The area of a rectangle is 55 m^2 , and the length of the rectangle is 4 m less than three times the width. Find the dimensions of the rectangle.