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

Help please.... someone?
Convert 1.20 g/mL to the unit g/m3. answers: A) 1.20 x 106 g/m3 B)1.20 x 102 g/m3 C)1.20 x 10-2 g/m3 D) 1.20 x 10-6 g/m3
What are the four major types of conflict and which best describes the main conflict in "The Pit and The Pendulum" by Edgar Allen Poe ?
How does the Federal Reserve discount rate affect the money supply?   A. The Federal Reserve lowers the rate in order to encourage banks to lend more.   B. The
If the area of a square living room is 169 square feet . What is the perimeter of the room
Why did the us government want to obtain california
Will give Brainliest! if right! Joseph Mobutu was the military leader who came to power and became a dictator in what country? Equatorial Guinea Democratic Repu
I need this factored
Write an I am poem about rosa parks it must be at least 4 stanzas and every line must star with I .
The table can be used to determine the solution to the system of equations, 2y − x = 8, and y − 2x = −5. Which solution can be used to fill in both blanks in th