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

varmint is an example of what language?
a truck has an average speed of 5050 miles per hour. how long will it take for the truck to go 550550 miles?
ginger wants to join a gym. she goes to the local gym and is told that there is a one-time fee of $100 to join and then a monthly fee of $30. what algebraic exp
The Embargo Jefferson declared against Britain in 1807 A) disrupted the British economy and closed British factorit's B) caused a substantial increase in profi
27,643,087 nearest million
Which legal system was more organized. The byzantine legal system or Rome's legal system? Explain
Which statement describes the most common characteristic of oral narratives? a. the audience can participate. b. characters face internal struggles. c. they
Which statement describes the most common characteristic of oral narratives? a. the audience can participate. b. characters face internal struggles. c. they
define disposition as used in the article
how to divide 83.7 by 0.03