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

A Museum opened at 8:00 a.m. In the first hour, 350 people purchased admission tickets. In yhe second hour, 20% more people purchased admission tickets than in
What distinguishes bacteria from archaea? see section 26.1 (page 520) . view available hint(s) what distinguishes bacteria from archaea? see section 26.1 (page
Fertilization occurs in the fallopian tubes.
What event started the collapse of the Byzantine Empire
which group may provide the best perspective on student life at a particular school
A cylindrical soft drink can has volume of 4.75 cm3. The area of the base is 1.3 cm2. What is the height of the soft drink can? (Use 3.14 for π .)
Explain how to find 3/4 of 20 using a model. Include a drawing
how does atp provide energy to our body
why were americans fighting along with colombians, ethiopians and puerto ricans
What is 842/52 with remainder?