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

Given angle 1 and angle 2 are supplementary. Prove p is parallel to q.
Hi, can I have help with number 45? Thank you
2. The scale from the real Eiffel Tower to the scale model is 15 ft to 3 in. What is the unit rate?
Linear function ху 60 10-8 The values in the table represent a linear function. How does the value of y change in relation to a change in the value of x? A) for
If u = 2i - j; v= -5i + 4j and w = j find 4u (v -w).
How does convection transfer heat from the fire to the marshmallows. The picture is more clear now
write the linear equation from the points below using y=mx+b
I need help to solve. This is my daily practice assignment
helppppodbdvdhrbfhrb
The type and number of fish caught in the Charleston Harbor in March was recorded for a month. The results are recorded in the table below. Whatis the probabili