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 are the sun ray's like mathematics rays?
most followers live in East and Southeast Asia A. Hinduism B. Buddhism C. Christianity D. Islam E. Confucianism
how do you solve this problem? 6d=54;d=9
Compare 6/10 & 3/4. Use _ as a common numerator
Appetite is not linked to
i need urgent help...How did the American Revolution influence the French Revolution? Soldiers who had fought on the side of the colonies started the French Rev
Which type of white blood cells produces antibodies? A. B-cells B. T-cells C. microphages D. macrophages
How is the cell cycle important to some unicellular organisms?
have 90 questions got 18 wrong what's percent for correct
A current of 3.60A flows for 15.3s through a conductor. Calculate the number of electrons that pass through a point in the conductor in this time