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

Why did the railroads initially divide the united states into four standard time zones apex?
Although bulimia nervosa is often referred to as the "binge-purge" disorder, this is misleading because
Species richness increases A) as one travels north from the equator. B) as one travels north from the South Pole. C) on islands as distance from the mainland in
Which scientific force is primarily responsible for maintaining control of your vehicle?
How did the conglomerate and the franchise system change the american economy after world war ii?
The gravitational force between two objects is 1600 N what will be the gravitational force if they double
P(x|y) What is this formula?
EJ has shown that a function, f(x) grows by 12% for every unit in the domain. What does this prove? The function f(x) is an anthmetic sequence The function f(x)
The feeding relationships among the species in a community determine the community's A) secondary succession. B) ecological niche. C) trophic structure. D) spe
Please help out if you are any good with linear equations. Showing/explaining your work would be greatly appreciated!