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

Cos (sin^-1(15/17))
Find the center and radius of the circle. (x − 1)2 + (y + 3)2 = 49
Determine whether the triangles are similar. If so, write a similarity statement and name the postulate or the theorem you used. If not, explain.
What were the three main advantages for the Americans during the American revolution?
Some individuals believe that the genetic engineering of crops has the potential to save lives and prevent starvation. Others believe the risks are too great. D
The first political parties were created the creation of the national bank. A.) After B.) Before Hamilton’s debt plan was passed the new capital of Washington
What is the mSRW ?? (no answer choices)
Can you help me edit these please? My teacher said I need to double check these verbs. 1. Es muy bueno que Carlos viaje a *España.* 2. Es muy bueno que tu *fuer
How does nicotine affect the respiratory system? it increases some reflex actions. it increases muscle action in the airways. it decreases mucus production. it
please help me out I'm really confused